🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #5510

Re: generating afm files

#5510
From: Jeff Rife
Date: Mon, 29 Apr 1991 14:57
60 lines
3712 bytes
In article <1991Apr25.175643.25619@milton.u.washington.edu> donley@milton.u.washington.edu (Erik Olson) writes:
>I've been reading this group for a couple months now, and have seen the
>regular-as-clockwork postings for:
>    - "Where can I get an HPGL->PS converter?"

Try Corel Draw on a PC running under Windows 3.0.

>    - "What's that silly binary code doing on the PFB files at [archive]?"

That's part of the encoding of an Adobe Type 1 font.  It's documented.

>    - "How do I make PFB files work on a postscript printer?"

Any *real* PostScript printer should be able to use them just fine, assuming
a new enough version of the PostScript interpreter.

>    - "How do I get a PFM file -> AFM file converter?"
>
>Rather than post the same questions, I chose to research the answers myself...
>Well, I managed to figure out the answers to all of these on my own through
>careful back-reading of articles, but have definitely hit a snag on the
>fourth, most puzzling, problem.  From all of your info, I understand that
>the PFB files do not contain all of the info as the AFM's.  I could write
>some sort of converter to get a minimum amount of information back into
>an AFM file, but I was thinking of another possibility:  What about
>reconstructing the AFM file from the postscript font itself?  Assuming
>one has a decoded type-1 or type-3 font, is this possible?  Furthermore, is
>it simple, or should I spend 3 months reading Adobe font documents before
>attempting this?
>

You can't ever get all the info from the PostScript font, whether it be Type 1
or Type 3.  Unless it is explicitly added by the creator, the PostScript
font file alone does not contain any kerning information.  This is the
primary reason for Adobe Font Metrics files (created by Adobe Systems, Inc.)
and Printer Font Metric files (standard created by Hewlett-Packard, with
revisions by somebody (?) to include PostScript).

These files contain information on character widths, kerning information,
font family, font weight, italic status and angle, and other things that
applications need to know about the font.  (Let's face it, MacWrite,
FrameMaker, PageMaker, etc., couldn't care less what the letter 'A' looks
like--they just want to know how wide it is and how to kern it with a 'W'.)

It is possible to reverse engineer this stuff, but I think the best thing to
do would be to ask the designers of these file formats what they contain.
Adobe gives away the specifications to AFM and Type 1 fonts--just ask.  I
don't know about the PFM format, but I guess asking HP would work.  Once you
have the correct formats, the program would still have to use some pretty
good heuristics for the tough questions, like what if the PFM file says the
font is italic, but the PFB has "/IsItalic false def" in it?  And what if
that same PFB says "/fontname Foobar-Italic def"?

Just my $.02.

--
Jeff Rife   P.O. Box 3836   |   "Because he was human; because he had goodness;
College Station, TX 77844   |    because he was moral they called him insane.
(409) 823-2710              |    Delusions of grandeur; visons of splendor;
jlr1801@aim1.tamu.edu       |    A manic-depressive, he walks in the rain."
Technical Details
Message-ID: <15506@helios.TAMU.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!helios!aim1!jlr1801
References: <1991Apr25.175643.25619@milton.u.washington.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!helios!aim1!jlr1801
From: jlr1801@aim1.tamu.edu (Jeff Rife)
Newsgroups: comp.lang.postscript
Subject: Re: generating afm files
Keywords: afm
Message-ID: <15506@helios.TAMU.EDU>
Date: 29 Apr 91 14:57:50 GMT
References: <1991Apr25.175643.25619@milton.u.washington.edu>
Sender: usenet@helios.TAMU.EDU
Organization: City of College Station, Texas
Lines: 60