Laserwriter 8 Spooling and Fonts Regarding How Laserwriter 8 Works with Fonts
Total Page:16
File Type:pdf, Size:1020Kb
TN1146: LaserWriter 8 and Fonts Page: 1 CONTENTS Many developers and prepress houses have contacted Apple for detailed information LaserWriter 8 Spooling and Fonts regarding how LaserWriter 8 works with fonts. They request this information so that they can Character Encodings better optimize their applications and Font Keys workflows. This Technote gives a brief overview of font and printer driver interactions Font Downloading for LaserWriter 8, versions 8.6 and 8.6.5. Classic TrueType Support Updated: [May 10 1999] OFA Font Support Double-Byte Font Support Font-Related Queries Font Preferences Bits Summary References Change History Downloadables LaserWriter 8 Spooling and Fonts Prior to generating any PostScript code to image a given print job, LaserWriter 8 needs to know whether the fonts the document requires are available in the target output device. This affects the way the driver handles font queries and font downloading. Background printing During background printing (2-pass printing), LaserWriter 8 gathers information about all the font requirements of a document prior to generating any PostScript code to render the document. The first pass gathers the document's font requirements and saves the information in the spool file. This data consists of the QuickDraw name of each font used in the document (that is, the resource name of its 'FOND' resource), along with any QuickDraw style bits (bold, italic, and so on.) applied to it. During the spooling pass, LaserWriter 8 knows nothing about which fonts are resident in the printer. At the beginning of its second pass, after all the application drawing has occurred and been recorded into the spool file, the TN1146: LaserWriter 8 and Fonts Page: 2 driver issues a font query to find out which of the needed fonts are available on the target output device. See the section Font-Related Queries for more information about the form of the driver's font queries. Since the driver knows about all font usage at the start of the second (printing) pass, it can include downloadable fonts more intelligently. See the section Font Downloading below for more information. Foreground printing When a document is printed in foreground (one-pass printing), the driver cannot record all the font information in the document prior to generating the PostScript code to image the document. Therefore, the driver handles the font information as it goes along. Before the application does any drawing, LaserWriter 8 first obtains the complete list of fonts in the printer so it has this information before it generates any PostScript code. The Font-Related Queries and Font Downloading sections discuss in more detail how foreground printing is handled. Back to top Character Encodings Because Macintosh screen fonts and PostScript fonts may use different character encodings, LaserWriter 8 must sometimes redefine the encoding vector for each PostScript font used in the client's document to match the host font encoding. For each font, the driver's behavior is determined by bits 1 and 9 of the Font Classification word in the font's 'FOND' resource. The Font Classification word is described in Inside Macintosh:Text, pp. 4-100 through 4-101. Table 1. The Font Classification Word in a 'FOND' Resource 0 Font name needs coordinating (ignored by LaserWriter 8) 1 Macintosh vector reencoding scheme is required 2 Font has outline property by changing PaintType to 2 3 Disallows outlining simulation by smear and whiteout 4 Disallows emboldening by smear technique 5 Emboldening is simulated by increasing point size 6 Disallows obliquing for italic 7 Disallows automatic simulation of condensed style 8 Disallows automatic simulation of expanded style 9 Requires reencoding other than Macintosh vector encoding Signifies the font family should have no additional intercharacter 10 spacing other than the space character 11-15 Reserved Mac-encoded fonts Fonts with bit 1 set are considered to be Mac-encoded fonts. For these fonts, the printer version of the font is "reencoded" so that the printer font used by the driver is encoded to correspond to the Macintosh Standard Roman Encoding. For Macintosh characters that are not included in Adobe's standard PostScript Roman character set, LaserWriter 8 generates PostScript code to use the printer's resident Symbol font and images them from there. Table 2 shows the mapping from Macintosh character codes to characters in the Symbol font. Table 2. Characters substituted from Symbol font TN1146: LaserWriter 8 and Fonts Page: 3 Mac Encoding Symbol Encoding Character Name (decimal) (decimal) ¬ notequal 173 185 ¥ infinity 176 165 £ lessequal 178 163 ³ greaterequal 179 179 ¶ partialdiff 182 182 å summation 183 229 Õ product 184 213 ? pi 185 112 ò integral 186 242 ? Omega 189 87 Ö radical 195 214 ? approxequal 197 187 ? Delta 198 68 à lozenge 215 224 Euro 219 160 apple 240 240 Note 1: On most PostScript printers, the Symbol font contains a description of the Macintosh Apple character ( ) decimal 240 in the Macintosh character set). However, printers from vendors other than Apple typically do not include this character in the encoding vector for the Symbol font, making the character inaccessible when printing without reencoding. LaserWriter 8 explicitly reencodes the Symbol font to include the Apple character, ensuring that it will print correctly even on non-Apple printers. Note: PostScript printers with a PostScript language level of 1 or 2 do not include the Euro glyph in the Symbol font. In order to print the Euro glyph on these printers, LaserWriter 8 downloads a Type 1 Euro glyph and maps it into the printer's Symbol font. The Roman fonts shipping with Mac OS 8.5 have the Euro glyph included. Other Encoded Fonts A font whose Font Classification word does not have bit 1 set is not considered to be a Mac-encoded font. In this case, LaserWriter 8 does not apply the MacEncoding vector, and in addition does not switch to the Symbol font to image any characters; all characters are imaged out of the original font. If bit 1 is not set, the driver determines how to handle the encoding by looking to see whether bit 9 of the Font Classification word is set. This bit specifies whether the font is to be reencoded on the printer to a special encoding. If bit 9 is not set, the driver does no re-encoding of the font in the printer. If bit 9 is set, LaserWriter 8 changes the encoding of the printer font as described by the glyph-name encoding subtable. The format and location of the glyph-name encoding subtable in the 'FOND' is described in Inside Macintosh-Text, pp. 4-105 through 4-106. If bit 9 is set, the driver uses the glyph-name encoding subtable as a list of encoding positions and character names to change the PostScript font encoding. The list is used as a delta from the PostScript font's original encoding. For example, if the glyph-name encoding subtable contains two entries: ( $A8, "diamond") ($A9, "heart") the LaserWriter driver changes the encoding of the PostScript font so that it has the original encoding, only changed so that the encoding vector at position $A8 now contains the name "/diamond" and that at $A9 contains the name "/heart". Special Case: Both bits 1 and bit 9 Set TN1146: LaserWriter 8 and Fonts Page: 4 The LaserWriter driver special cases the situation where both bits 1 and bit 9 are set. In this case, it uses bit 9 as an indicator that a special encoding is needed and uses the glyph-name encoding subtable as described above to apply a delta encoding to the original font encoding vector. If bit 1 is also set, LaserWriter 8 treats the font as if it must switch to Symbol in order to image the set of characters listed in Table 2. Back to top Font Keys LaserWriter 8 generates PostScript code so that it draws in the QuickDraw coordinate system. This coordinate system has the origin at the top, left corner of the imageable area of the page (as defined by the print record margins) and the Y coordinate increases going down the page. Before using a font defined in standard PostScript format, LaserWriter 8 must invert the font matrix by applying a vertical scale factor of - 1 (using the PostScript makefont operator) to compensate for the fact that the font's coordinate system the font is flipped in Y from the standard PostScript coordinate system. After applying this modification, it saves the modified version of the font in its md dictionary for later use under a font key of the form /fm where m is a serial number denoting the particular font and style. In addition, a font may be further modified to produce derived-style variations required by the client's document, such as synthetic bold, synthetic italic, outline, shadow, condensed, or extended. Each derived variation is considered a separate font and is given its own serial number for use in forming font keys. Thus, for example, the key /f724 might denote 12-point Helvetica synthetic bold outline. Outline and shadow versions of a font normally outline the characters by changing the PaintType entry in the font dictionary from 0 to 2, causing the outline of each character to be stroked instead of filled (PostScript Language Reference Manual, Second Edition , section 5.2). However, this technique does not work with some fonts (bitmap screen fonts in particular, as well as some PostScript fonts such as older versions of Courier). If a font's 'FOND' classification word indicates that outlining cannot be performed by using PaintType 2, the driver uses its own PostScript routines to generate the outline and shadow forms by 'smearing" the character image: drawing it repeatedly with a slight offset up, down, left, and right, followed by a final time, centered in white, to "punch out" the interior of the character.