Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Appendix B - Using Picture Comments for Printing


Picture Comments to Avoid

The SetGrayLevel picture comment is now obsolete. The PostScriptFile, TextIsPostScript, FormsPrinting, EndFormsPrinting, ClientLineLayout, PSBeginNoSave, and ResourcePS picture comments have limited use and are not recommended. This section describes the shortcomings of these picture comments.

The SetGrayLevel picture comment was designed to provide access to the PostScript setgray operator while drawing with QuickDraw in black-and-white mode. For most drawing operations, however, the printer driver sets the gray level to match the foreground color for the printing graphics port, and the effect of the SetGrayLevel picture comment is often unpredictable. If direct access to the PostScript setgray operator seems desirable, it is preferable to send the instruction with the PostScriptHandle picture comment.

The TextIsPostScript picture comment interprets all the text manipulated with QuickDraw text-drawing routines (namely, DrawChar, DrawString, DrawText, and anything else that calls the StdText low-level procedure) as PostScript code. There is no good reason to use this picture comment, but there is one important reason not to use it: printer drivers that do not support the TextIsPostScript picture comment will print the PostScript text instead of interpreting it. If you need to transmit PostScript code directly to a printer that understands it, use the PostScriptHandle comment and include a QuickDraw representation for all other printer drivers.

The ResourcePS picture comment loads PostScript code from a resource file. The resource file is expected to be open at the time that you use ResourcePS. Under background printing, there are no guarantees the resource file will still be open when the Printing Manager needs it. If you want to keep PostScript code in a resource file, it is easy to write a routine that loads the resources and sends their contents using the PostScriptHandle picture comment.

The PostScriptFile picture comment loads PostScript code from a file; as with the ResourcePS comment, there are no guarantees the file will be open when the Printing Manager needs it during background printing. If you want to keep PostScript code in a file, it is easy to write a routine that loads the file and its contents using the PostScriptHandle picture comment.

As with the PostScriptBegin picture comment, the PSBeginNoSave picture comment allows applications to change the state of a PostScript printer driver. Some applications do not want to restore the previous state of the PostScript interpreter after sending PostScript code; the PSBeginNoSave comment was intended for situations where applications do not want to preserve the printer state. However, the PSBeginNoSave picture comment allows applications to interfere with the LaserWriter 8.0 printer driver, and the driver, by calling the PostScript operator grestore, can interfere with the application. The use of PSBeginNoSave can lead to incorrect clipping, incorrect colors, and PostScript language errors and should therefore be avoided.

By default, most drivers apply about 80 percent of the total line layout error to the major glyphs (the space character) and the other 20 percent to the minor glyphs (all other glyphs). (When using a script system that does not use the space glyph to delimit words, the layout error is distributed evenly across all characters in the font.) The ClientLineLayout picture comment allows applications to redefine the major glyph, and the percentages of the line layout error assigned to the major and minor glyphs. The ClientLineLayout picture comment is rather subtle and very specific to the PostScript LaserWriter driver. Only very ambitious page layout applications might be interested in this functionality, however; their designers should instead aim at a more general scheme of line layout control that does not rely upon this very driver-specific picture comment.

Intended for printing forms on PostScript LaserWriter printers, the FormsPrinting picture comment directs the PostScript LaserWriter driver not to clear its page buffer after printing a page. The EndFormsPrinting picture comment directs the PostScript LaserWriter driver to clear its page buffer after printing a page. When a page is completed, applications must erase the areas that need to be updated and draw the new information. The graphics that make up the form are drawn only once per page, which may improve performance. However, you need to write a separate printing loop for the PostScript LaserWriter driver if you want to use this comment.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996