The FOND's style mapping and name tables contain the information for matching a PostScript font to a bitmapped font. The style mapping table is used by the LaserWriter driver and contains the font class and character encoding information plus a mechanism for getting the name of the PostScript printer font. When you request to print a particular font and style, the driver checks the "FOND" for a style mapping table. If the table is present, it then looks up the PostScript name of the style to print.
The name table is actually a table within the style mapping table that contains an array of indices that help build the font name suffix for each possible style in the font family. The name table has the following format:
NameTable = record
stringCount : integer;
baseFontName : str255;
{strings : array [ 2..stringcount ] of String; }
end;
The name table contains the number of strings followed by the base font name (the string count includes the base font name). The base font name is followed by strings containing suffixes or numbers specifying what suffixes to put together to get the real PostScript font name. Here's an example:
|______Helvetica-BoldOblique
The "|______" prefix is added by the driver (a vertical slash with six underline characters). The base font name is "Helvetica". The suffix to get the right font name to get the bold and italic style is "-BoldOblique", and the index in the index array for style $03 (BoldItalic) contains four. For our example, the string list for this font would have the following entries:
1 Helvetica
2 9 10
3 9 11
4 9 10 11
5 9 12
6 9 12 9 10
7 9 12 9 11
8 9 12 9 10 11
9 -
10 Bold
11 Oblique
12 Narrow
If you take a look at string 4, it has 9, 10, and 11 as entries. If you put these suffixes together you get "-BoldOblique". When the driver gets a name, it checks to see if the printer already contains it. If it does not, the driver checks the System file for a file with the name "HelveBolObl". If it finds one, it dumps the contents of the file to the printer and uses the font. Otherwise, it dumps a QuickDraw bitmap, which gets scaled to the right size.
The printer font filename (in our example HelveBolObl) is derived from the PostScript name using a simple algorithm. The filename is found by dissecting the PostScript name, contained the name table, into pieces based on capital letters and hyphens. The first five letters of the first piece followed by the first three letters of any subsequent components. The maximum number of letters that can compose a filename is 31 characters. This is a restriction of HFS. For example, given the following PostScript names, here are the equivalent printer font file names:
Palatino-Italic = PalatIta
Courier-Bold = CouriBol
Times-Roman = TimesRom