[comp.fonts] Type 1 .PFB Format question

<13501DRJ@MSU.BITNET> (03/29/91)

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.

Also (just curious), what effect do the
Serif false
Pi false
flags have when building .PFMs and such (in the .INF files)?

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)

In experimenting with the PC fonts I already have, i've found that if the
two variable bytes (XX) are changes, the font will appear in the menus, but
no longer be rasterized.

Any info would be appreciated...

oovvoo@mixcom.COM (Mike Shawaluk) (04/01/91)

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."

jaglowsk@galaxy.cps.msu.edu (David R Jaglowski) (04/02/91)

I found documentation of the PC and MAC formats in a file on the Adobe
server, and finally came up with a ssetup to transfer the fonts without
having to use any commercial software...

If anyone is interested in the process, let me know. I'm working on a
revision of my translation program (if I have time) which take a little
more of the tediousness out of the translation process...

(If you're curious, I had to write a program that took UnAdobe output
from the mac and reassembled it into PC format - the only problem I've
run into so far the makes it tedious is that many of the fonts I have
have the header "%!PS-AdobeFont-1.0" and from the discussions of WFNBoss 
(Corel Draw) I've gathered that the header should be
"%!PS-AdobeFont-1.0: <Fontname> <version>"...)

I still have to build the .INF files for the fonts, but I cooked those
down to the 5 basic lines you need to have and things work fine.

cbwood@churchy.gnu.ai.mit.edu (Clifton B. Wood) (04/03/91)

In article <1991Apr2.153354.19094@msuinfo.cl.msu.edu> jaglowsk@galaxy.cps.msu.edu (David R Jaglowski) writes:
>I found documentation of the PC and MAC formats in a file on the Adobe
>server, and finally came up with a ssetup to transfer the fonts without
>having to use any commercial software...
>
>If anyone is interested in the process, let me know. I'm working on a
>revision of my translation program (if I have time) which take a little
>more of the tediousness out of the translation process...

Yes, I am interested, as I know of a friend of mine who has lots of fonts on theMAC that I am interested in. Leave me mail on how to obtain it. My mailing 
address will be in the sig...

>(If you're curious, I had to write a program that took UnAdobe output

One question: What is "UnAdobe output"?

					Cliff

					cbwood@gnu.ai.mit.edu
					aralyn@eddie.ee.vt.edu

jaglowsk@galaxy.cps.msu.edu (David R Jaglowski) (04/03/91)

UnAdobe output is from a program called UnAdobe availible from the
UTIL directory of any INFO-MAC server... Right now the process is pretty
complex as far as the fixes to the .PFB files and making .INF files. I
don't have that many fonts (Just the ATM Plus Pack from IBM and 2-3 mac
faces...) so I don't know if it's worth the time to work more on my
program... I can post the source (PASCAL) and tell you the critical lines
of the .INF files, but that's about all...

From what Adobe posted earlier, I gather this is a 'legal' way to port
fonts you already have (It leaves the copywrite message intact)... But 
just because they're converted doesn't mean they're PD...

cbwood@churchy.gnu.ai.mit.edu (Clifton B. Wood) (04/03/91)

In article <1991Apr2.200600.16550@msuinfo.cl.msu.edu> jaglowsk@galaxy.cps.msu.edu (David R Jaglowski) writes:
>... I can post the source (PASCAL) and tell you the critical lines
>of the .INF files, but that's about all...
>

OK, that might work. It would be something else for me to work on in Pascal over the summer!  ;)

>... But 
>just because they're converted doesn't mean they're PD...

OK, so I guess I've got to be careful of what I port over, I guess. How can you 
tell if a Font is PD or not though?

						Cliff

						cbwood@gnu.ai.mit.edu
						aralyn@eddie.ee.vt.edu

drp@dosbears.UUCP (David R. Preston) (04/03/91)

In article <443@mixcom.COM> oovvoo@mixcom.COM (Mike Shawaluk) writes:
>13501DRJ@MSU.BITNET writes:
>
>>I've tried looking through the redbook for this, but haven't found anything.
>
>I don't have any reference materials on the internals to Type 1 font files,

Adobe Systems Inc. (corporate author) "Adobe Type 1 Font Format,
Version 1.1".  Addison-Wesley Publishing Co. Inc., 1990. 
ISBN 0-201-57044-0.

David Preston
drp%dosbears.uucp@ingres.com