ADC Home > Reference Library > Technical Notes > Legacy Documents > Printing >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
LaserWriter 8 Spooling and FontsPrior 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 printingDuring 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
At the beginning of its second pass, after all the application drawing has occurred and been recorded into the spool file, the 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 printingWhen 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. 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
Table 1. The Font Classification Word in a
Mac-encoded fontsFonts 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
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
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: Special Case: Both bits 1 and bit 9 Set 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. 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
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 In LaserWriter 8.6.5, users can check the "Annotate Font Keys" checkbox from the "Font Settings" panel, causing the driver to insert comments into the PostScript output stream immediately before it uses a font key. This feature was added to aid the troubleshooting of font problems in the PostScript files generated by LaserWriter 8. The comment inserted follows the form:
In this case, the font key represents application drawing in the QuickDraw font Geneva, 12 is the pointsize, and "bold" is the font style selected. Font DownloadingWhen searching for a downloadable font on the host Macintosh, LaserWriter 8 looks for any of the following, in order of priority:
For fonts that are not already available on the target output device,
LaserWriter 8 attempts to download a suitable version from the host
Macintosh as part of the PostScript output stream. It first determines if the font is a Type 1
If the font is not a Type 1
1. Obtain the base font name from the style mapping table of the
2. Truncate each suffix to three characters needed to satisfy a
QuickDraw style as specified by the style mapping table. For example
the suffix "Bold" becomes "Bol" and "Light" becomes "Lig". Each
triple is appended to the truncated base name. The driver searches for the font file in the following locations, in the order listed:
If the PostScript font file is not available on disk and the font is a classic TrueType version, it is handled as described in the Classic TrueType Support section. If the font is not a classic TrueType font but is instead an OFA-only font, the driver uses OFA to download the font. The section OFA Font Support below describes the details.
If the font is none of the above types, the driver uses the QuickDraw
bitmap (screen) version. Using the bitmap font, the driver constructs
a PostScript Type 3 font using the PostScript
Saving to Disk
When saving to a disk file rather than printing to a printer,
LaserWriter 8 never includes bitmap versions of PostScript fonts,
regardless of the "Font inclusion" setting in the Save dialog.
Instead, it simply includes an Adobe Document Structuring Conventions
(DSC) Substitute FontsIf the user has checked the "substitute Fonts" option in the PostScript Options panel of the Page Setup dialog, the driver replaces all occurrences of the standard Macintosh screen fonts Geneva, New York, and Monaco with the PostScript equivalents Helvetica, Times, and Courier, respectively. The substitution occurs even if TrueType outline fonts are available for Geneva, New York, and Monaco. Text sizes in the document are appropriately scaled to compensate for size differences between the corresponding families of screen and printer fonts: for instance, each size of Times is scaled by a factor of 1.087 to approximate the corresponding size of New York. Unlike the LaserWriter 7 driver, LaserWriter 8 does not suppress font substitution if the client program has enabled QuickDraw's fractional character widths. Standard Font DownloadingWhen background printing, the driver knows the entire document's font needs prior to its generation of PostScript output. Ordinarily, when background printing, all of a document's downloaded fonts are transmitted just once at the beginning of the document, as part of the job setup section preceding the first page. LaserWriter 8, when printing directly to a printer, but not to a print queue server or to disk, can delay the downloading of a given font to just before the start of the page with that font's first occurrence. Fonts are downloaded once for each document, and are downloaded so that they remain in PostScript VM for the duration of the document. When foreground printing, fonts are downloaded as they are encountered within a document. Each font is downloaded outside of the PostScript page level save, and therefore remains in the printer's VM for the duration of the job. Unlimited Downloadable FontsThe "Unlimited Downloadable Fonts" option in the PostScript Options panel of the Page Setup dialog modifies the behavior described above for foreground and background printing so that instead each downloadable font is sent each time it is switched to within the document. This minimizes the demands on printer memory by, in effect, keeping only one downloaded font resident at a time, but it can significantly affect the time needed to print the document.
Classic TrueType Support
If no PostScript version of a required font is available, either on
the target output device or on the host Macintosh, LaserWriter 8
looks for a classic TrueType font to download from the host machine.
LaserWriter 8 classifies a font as a classic TrueType font if it
contains a resource of type
In order to use TrueType fonts directly for drawing text, the PostScript interpreter on the output device needs a copy of Apple's TrueType rasterizing code, known as the TrueType scaler. The device may have its own resident copy of the scaler, or, for some printers, it may be included in the PostScript output stream as one of LaserWriter 8's downloadable procedure sets. The downloadable rasterizer only works on some level 1 PostScript interpreters. In order to download the scaler, all of the following conditions must hold:
The response LaserWriter 8 receives to its print-time *TTRasterizer feature query tells whether the device has its own copy of the scaler or, if not, whether it can accept a copy in downloaded form. LaserWriter 8 uses this information to determine how to handle TrueType fonts:
If the status of the scaler on the output device is unknown (for example, if the PostScript output is being saved to a disk file or sent to a spooler that does not understand the *TTRasterizer feature query), LaserWriter 8 includes the scaler in the PostScript output stream and transmits each TrueType font in both a Type 42 and an unhinted Type 1 version. In this case, the driver also emits conditional PostScript code to test the availability of the scaler at print time and load it into the device's memory only if the device can accept it and doesn"t already have a built-in copy. If the scaler is available at print time (whether built-in or downloaded from the PostScript output), the conditional code uses the Type 42 version of each font and discards the Type 1 version; if not, it uses the Type 1 version and skips the Type 42 version.
Protected Fonts
LaserWriter 8.6.5 introduces special handling of protected fonts.
Some TrueType fonts contain a special OFA Font SupportFonts which are considered to be "OFA-only fonts" are only available and supported on Mac OS 8.5 and later. For these fonts, the driver itself does not know how to generate the PostScript version of the font; it asks OFA to do so. In this case, the driver tells OFA what font it requires and what type of output the PostScript interpreter can handle; OFA is then responsible for streaming the PostScript version of the font into the output data stream. When the driver requests a font from OFA, it indicates what the supported output types are, and OFA is then responsible for generating one of the types that can be supported. When printing to a PostScript device where it knows that Type 42 data can be directly supported, the driver indicates that Type 42, Type 1, and Type 3 output are supported. If the driver knows that the device cannot support Type 42 data, then the driver indicates that Type 1 and Type 3 output are supported. If the driver does not know whether Type 42 can be supported, it requests a portable format. When using OFA, the LaserWriter 8.6 driver never requests the downloadable TrueType scaler format described above.
As of Mac OS 8.5, OFA generates Type 1 (or perhaps Type 3) output for the portable format requested by the driver. OFA does not generate the wrapper containing both Type 42 and Type 1 fonts described above for classic TrueType font support. This means, for example, that when saving to disk, an OFA-only font is never inserted into the stream as a Type 42 font, only as Type 1 font data.
LaserWriter 8.6.5 adds support for OFA fonts that are so-called data
fork fonts. These fonts do not have the traditional
Double-Byte Font SupportThe character sets for Chinese, Japanese, and Korean fonts are typically thousands of characters and require 2 bytes of data to specify a given glyph. Such fonts are frequently called "CJK fonts" and support for such fonts is called "CJK support." Because these fonts are very large (megabytes in size), it is impractical to download these fonts to PostScript printers as part of a print job. For this reason, LaserWriter 8's support for CJK fonts in the Macintosh OS is handled differently than that for traditional 1 byte fonts. This support is done by working with WorldScript II.
On the Macintosh, text drawing is done through the
In some cases, the text coming to the driver's text bottleneck needs
to be intercepted and handled specially by system software. This is
made possible by the driver's use of the print action routine.
Immediately after LaserWriter 8 inserts its bottlenecks into the
printing port, it calls the Script Manager's print action routine.
When it calls the print action routine, it passes in the printing
port and a verb indicating the action it will take with that port.
The action verbs consist of
The driver's call to the print action routine allows the Script
Manager to replace the driver's
In principle, all drawing of 2-byte text could be drawn on the host
as bitmaps, but this would result in slow performance and would not
utilize any 2-byte fonts that were actually available in the printer.
Instead, if the current font used for drawing is a 2-byte font,
WorldScript II's text bottleneck routine calls the LaserWriter 8
driver to determine whether the font used for this call to the text
bottleneck is available in the printer. If driver reports that the
font is available in the printer, WorldScript II's text bottleneck
calls through to the driver's text bottleneck and the driver's
bottleneck generates the PostScript code necessary to draw the text
in the printer. If the LaserWriter 8 driver reports that the font is
not available in the printer, WorldScript II images the text on the
host and calls
Background Printing
During background printing, the driver first spools all drawing to
disk. The print action verb
On the second pass of background printing, the driver uses the print
action verb Foreground Printing
During foreground printing, the driver calls the print action routine with the verb Font-Related QueriesThe LaserWriter 8 driver uses two different font queries; one is for the availability of a specific set of fonts, while the other is for a full list of fonts available in the printer. The query used depends upon whether the driver is printing in foreground or background mode. Background PrintingWhen background printing, the LaserWriter 8 driver gathers the list of PostScript fonts used in the document during the spool pass, and queries the printer about the availability of each font. The font query takes the following form: %%?BeginFontQuery: <list of font names> . . . % PostScript code to find font availability %%?EndFontQuery: Unknown
The %%?BeginFontQuery: Times-Roman Times-Bold Minion Helvetica
For each required font, the driver uses the QuickDraw name recorded
in the spool file to access the font description resource, which
contains a style mapping table giving the corresponding PostScript
font name, which is dependent on the QuickDraw style attributes taken
from the spool file. The driver then uses this PostScript name in its
print-time font query. PostScript Level 1 output devices respond to
the query by reporting a font available if it is permanently resident
in the device's ROM, or if it is currently present in RAM or on a
disk connected to the device. On Level 2 devices, the query code
determines the font's availability via the PostScript
The response to the query indicates which of the specified fonts are already available on the target device; the driver then downloads the remaining fonts as part of the ensuing print job. See below for further specifics on this query.
Requests information about the availability of PostScript fonts on the target output device. LaserWriter 8 uses this information to decide which fonts to include as part of the ensuing print job. If the PostScript output is being saved to a disk file rather than sent directly to a printer, the equivalent information is provided by the user in the "Font inclusion" item of the Print dialog's Save panel. Under version 3.0 of the Document Structuring Conventions, the correct response to this query is of the form:
where each font name is followed by a colon and the word "Yes" if the given font is available on the target device, "No" if it is not. Notice that each font name is preceded by a slash character (/) in the response to the query, but not in the query itself. Notice also that the fonts appear in the response in reverse order from the way they are listed in the original query, and that the entire response is terminated with an asterisk (*). For example, the response to the query:
Some print queue servers (notably the AppleShare print server prior to version 5.0) use an older form of response to the font query, as defined by version 2.0 (rather than 3.0) of the Document Structuring Conventions. For compatibility, LaserWriter 8 also accepts responses of this form. Such responses simply use the integers "1" and "0" instead of "Yes" and "No" to indicate font availability, and do not include the font names themselves or the terminating asterisk: for example, 10 1 1 As in the first form, the order of the fonts is reversed from the original query (Minion, Times-Bold, Times-Roman, and Helvetica in the example).
Foreground PrintingWhen foreground printing, the LaserWriter 8 driver does not know which PostScript fonts will be used in a document, and must therefore query the printer for its complete set of fonts. This font list query takes the following form:
PostScript Level 1 output devices respond to the query by
reporting all fonts available in The response to this query is the list of printer resident fonts in which each font name is preceded by a (slash) "/". The last font is followed by whitespace and an (asterisk) "*". For example, a printer might respond to the font list query with the following data:
See Adobe Technical Note #5001, PostScript Language Document Structuring Conventions Specification for more information on the font queries. In addition to the font queries just described, LaserWriter 8 queries the printer about the availability of a TrueType scaler. If the scaler is available, the query returns "Type42", and LaserWriter 8 downloads Type 42 fonts when appropriate. If the scaler is not in the printer, but the printer can accept a downloaded scaler, the query returns "Accept68K"; LaserWriter 8 then downloads a scaler to the printer and will download Type 42 fonts when appropriate. If the printer does not have and will not accept a TrueType scaler, the query returns "None"; LaserWriter 8 then converts TrueType fonts to unhinted Type 1 fonts and downloads these when appropriate. If the printer, or more likely a spooler, returns "Unknown" to the TrueType rasterizer query, LaserWriter 8 attempts to download the rasterizer and will send TrueType fonts down as both Type 42 and Type 1 when appropriate. The PostScript wrappers around the rasterizer and the fonts allow only the appropriate formats to be executed in the printer. The TrueType rasterizer query takes the following form:
Requests information about the ability of the target output device to accept fonts defined in Apple's TrueType format. Possible responses and their meanings are:
As described earlier, LaserWriter 8.6.5 allows the user to choose the
"Never generate Type 42 format" setting, which causes the driver to
always treat the results of the Font Preferences BitsLaserWriter 8.6 and 8.6.5 contain a preferences resource that allows
certain font-related behavior to be modified outside the normal
driver user interface. Editing of this preferences resource can
configure some of the driver's behavior when it handles fonts. The
resource of interest is the Use Symbol Font for Euro Currency SymbolThis preference setting in the Ignore Fonts in Printer When PrintingThis driver preference setting is "OFF" by default, and the driver treats any printer fonts it finds in the query as available for usage. If this driver preference is set to "ON", the driver ignores printer fonts and downloads all fonts as if the printer contained no fonts. This preference does not apply to save to disk jobs since the user can explicitly set this in the Print dialog.
In LaserWriter 8.6.5, there is explicit UI support for this feature
with the "Always download needed fonts" checkbox in the "Font
Settings" panel in the Print dialog. With LaserWriter 8.6.5, the
default setting of this checkbox comes from the user's saved
defaults. If the user has not saved a default value for this
checkbox, then its default value comes from the Always Generate Type 1 Versions of TrueType FontsThis driver preference setting is "OFF" by default, and the driver will download Type 42 versions of classic TrueType fonts or OFA fonts if the printer can support them as described above. If this driver preference is set to "ON", the driver treats the printer as if it cannot support Type 42 fonts and can only accept Type 1 versions.
In LaserWriter 8.6.5, there is explicit UI support for this feature
with the "Never generate Type 42 format" checkbox in the "Font
Settings" panel in the Print dialog. With LaserWriter 8.6.5, the
default setting of this checkbox comes from the user's saved
defaults. If the user has not saved a default value for this
checkbox, then its default value comes from the PrintingLib IssuesThe "PrintingLib" file, version 8.6 and 8.6.5, contains a similar
preferences resource of type
For the shipping configuration of Mac OS 8.5, which includes only
PostScript, EPS, PICT, and JPEG downloaders, these settings affect
drag-and-drop printing of PostScript, EPS and PICT files. When doing
drag-and-drop printing of PostScript or EPS files, the PostScript
downloader supplies fonts to satisfy the
SummaryWe hope that the detailed information contained in this Technote gives developers a good overview of how LaserWriter 8, versions 8.6 and 8.6.5, interacts with fonts. ReferencesAdobe's PostScript Language Reference Manual Technote 1140: The Euro Currency Symbol Technote 1169: The Download Manager Adobe Technical Note #5001, PostScript Language Document Structuring Conventions Specification Change History
Downloadables
|
|