Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!uunet!mixcom!oovvoo From: oovvoo@mixcom.COM (Mike Shawaluk) Newsgroups: comp.fonts Subject: Re: Type 1 .PFB Format question Message-ID: <443@mixcom.COM> Date: 1 Apr 91 13:41:08 GMT References: <91113501DRJ@MSU> Distribution: usa Organization: Milwaukee Information eXchange (Public access Usenet, Email) Lines: 55 13501DRJ@MSU.BITNET writes: >I've tried looking through the redbook for this, but haven't found anything. >Does anyone know the meaning of the leading 6 bytes of the IBM .PFB files? >In each case, it goes (in hex): > 80 01 XX XX 00 00 "%!PS-AdobeFont" etc... >Where XX changes from file to file. I don't have any reference materials on the internals to Type 1 font files, but after a bit of creative "reverse engineering" (which, hopefully, won't get me in too much trouble here), I have come up with the following conclusions: In an IBM .PFB file, there are multiple 6-byte headers in the file. The first one, which is at the beginning, is of the format you mention above, and the "XX XX" value is actually an Intel-byte-order size value, for the size of the "chunk" which follows, in bytes. Actually, I'm not certain, but I suspect that it's possible that the two 00 bytes which follow might actually be the m.s. 16 bits of this size... Anyways, if you thread your way through the file, using this size value, you should find yourself immediately after the "currentfile eexec" 0x0d, at which point is another header, this time: 80 02 XX XX 00 00. Use the new XX XX value, and you will likely find another 80 01 XX XX 00 00, which in turn will point to a shortened header at the end of the file, which is simply 80 03. >I just picked up the Adobe Plus Pack and found a utility to make .PFM >files from the .AFMs in the packages I origionally bought for the Mac, >but the Mac .PFBs (once I transfer them to the PC, there is a way to get >the resource fork data to the PC) don't work with ATM 1.1 - the font name >will only register if I change the leading 6 bytes of the MAC .PFB to PC >format (MAC is 00 00 XX XX 01 00 "%!PS-AdobeFont" etc) The Mac format is similar to the PC, except (to the best of my knowledge), exactly backwards! The XX XX values are in Motorola-byte-order (again, perhaps the LEADING zeros are the m.s. 16 bits), and the 2nd to last byte (01 in this case) seems to correlate with the 2nd byte in the IBM format. Another "gotcha" is that the value of the offset (XX XX) seems to be shifted by 4 (I forget in which direction, but you can re-reverse engineer it yourself in a minute or two, if you have Norton or a similar hex file editor, or even Buerg's LIST). Also, the Mac fonts I have seen (which, BTW, I have transferred to my PC) seem to consist of lots of individual segments, whereas the PC ones seem to be one huge chunk. There are some other special cases & differences between these file formats, but since all of my information is via second-guessing and pattern recognition, and not from any "real" sources of information, I will hold back from any further statements, assuming that there is someone out there more knowledgable than myself on this matter. Or, perhaps there is even a source of material about these file formats, now that the Type 1 format is no longer "top secret". Any help will, of course, be greatly appreciated. - Mike -- - Mike Shawaluk (oovvoo@mixcom.com) "It is a good day to live."