Path: utzoo!attcan!uunet!lll-winken!ames!pasteur!ucbvax!decwrl!labrea!polya!kaufman From: kaufman@polya.Stanford.EDU (Marc T. Kaufman) Newsgroups: comp.sys.mac.programmer Subject: Re: Screen font names <-> PS font names Message-ID: <5946@polya.Stanford.EDU> Date: 7 Jan 89 18:38:25 GMT References: <933@husc6.harvard.edu> Reply-To: kaufman@polya.Stanford.EDU (Marc T. Kaufman) Organization: Stanford University Lines: 25 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)