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: Text /
Chapter 3 - QuickDraw Text / Using QuickDraw Text


Customizing QuickDraw's Text Handling

The QuickDraw bottleneck routines are procedures that perform the fundamental tasks associated with QuickDraw drawing operations. For each type of object that QuickDraw can draw, including text, there is a low-level routine which the higher-level routines call that actually performs the operation. These low-level routines, called bottlenecks because so many of the higher-level routines use them, carry out the actual work of measuring and drawing text.

The QuickDraw text routines use two of the bottleneck routines extensively--one to measure text (StdTxMeas) and one to draw it (StdText). Most of the high-level QuickDraw text routines call the low-level routines. The use of bottleneck routines provides flexibility to QuickDraw and applications that need to alter or augment the basic behavior of QuickDraw.

The graphics port record contains a field (grafProcs) which is set by default to
NIL, indicating that QuickDraw should use the standard low-level bottleneck
routines. You can modify this field to point to a record, QDProcs, which holds the addresses of customized routines for QuickDraw to use instead of the standard ones.
For more information about the QDProcs record, see the QuickDraw chapters in
Inside Macintosh: Imaging.

You can set some of the fields of this record to point to the standard bottleneck routines, and some to point to your customized routines. Your customized bottleneck routine can augment the standard bottleneck routine by calling it directly, either before or after performing its own operations, or it can replace a standard routine. If you replace either of the two standard bottleneck routines used for measuring (StdTxtMeas) and drawing (StdText) text, the routines you install must have the same calling sequences as the standard routines. See "Low-Level QuickDraw Text Routines" on page 3-94 for these routines and their parameters. For the major discussion of how to customize the QuickDraw bottleneck routines, see Inside Macintosh: Imaging.

Note
Before replacing a bottleneck routine, consider the possibility that to do so could jeopardize the future compatibility of the application. If you replace either StdTxMeas or StdText, you change the behavior of the high-level routines that call them.
You can also customize QuickDraw's text drawing and measuring capabilities by
writing high-level routines that do additional processing, but call the standard bottleneck routines.

Note
If you need to call either StdText or StdTxMeas directly, you must first check the graphics port grafProc field to determine whether the bottleneck routines have been customized, and if so, you must call the customized routine instead of the standard one. The bottleneck routines are always customized for printing.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996