[comp.sys.mac.programmer] Screen font names <-> PS font names

fry@brauer.harvard.edu (David Fry) (01/07/89)

If I have the screen font name of a font, such as "Trump
Mediaeval", how do I find the equivalent PostScript name, such
as "TrumpMediaeval-Roman".  And how do I do the reverse?

And help would be greatly appreciated.

David Fry				fry@huma1.harvard.EDU
Department of Mathematics		fry@huma1.bitnet
Harvard University			...!harvard!huma1!fry
Cambridge, MA  02138		

kaufman@polya.Stanford.EDU (Marc T. Kaufman) (01/08/89)

In article <933@husc6.harvard.edu> fry@brauer.harvard.edu (David Fry) writes:

>If I have the screen font name of a font, such as "Trump
>Mediaeval", how do I find the equivalent PostScript name, such
>as "TrumpMediaeval-Roman".  And how do I do the reverse?

Start by looking at the Font Manager chapter of IM-IV.  You will see in the
Family-record, a field called ffStylOff.  This is the offset to the style
mapping table in the Family record (i.e. the style record starts at
the address of the Family record + [ffStylOff]).  The style table contains
some header data (10 bytes), then 48 bytes of information, indexed by the
'Style Code' (see IM IV-39).  Immediately following the style record is an
array of variable length Pascal strings.  String 1 is always the base name
of the font.  Following string 1 is a list of modifier strings: strings of
small integer(byte) values that are really indices to other strings in the list.
The string to use is the string whose index is the one you just looked up in
the 48 byte style table.

Try it, or dig through a FOND resource (which is the family-record).  Its really
much simpler than I described.  What's left is to prefix the name with whatever
the LW wants as a standard prefix.

I don't know how to go backwards, as that is a 1->many mapping.

Marc Kaufman (kaufman@polya.stanford.edu)