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 6 - Script Manager / Script Manager Reference
Routines / Replacing a Script System's Default Routines


GetScriptQDPatchAddress

The GetScriptQDPatchAddress function returns a pointer to the specified WorldScript I QuickDraw patch--or the built-in QuickDraw call--for the given
script system.

FUNCTION GetScriptQDPatchAddress (trapNum: Integer;
                                  before: Boolean;
                                  forPrinting: Boolean;
                                  script: ScriptCode): Ptr;
trapNum
A value that specifies the name of the QuickDraw routine whose
address is needed.
before
A Boolean that specifies which of two routines is needed. If TRUE, the address returned is that of the WorldScript I patch to the QuickDraw routine. If FALSE, the address returned is that of the original routine (usually the built-in QuickDraw routine).
forPrinting
A Boolean that specifies whether the desired routine is for printing. If TRUE, the address returned is that of a QuickDraw patch that is specifically for printing; if FALSE, the address returned is that of a QuickDraw patch that is not specifically for printing.
script
The numeric code that specifies the script system whose dispatch table contains the pointers to the QuickDraw routines. Constants for all defined script codes are listed on page 6-52.
DESCRIPTION
The GetScriptQDPatchAddress function examines the specified script's dispatch table and returns a pointer to the desired routine.

Because each element in the dispatch table consists of a pair of addresses, one for the WorldScript I patch to the QuickDraw routine, and another for the original QuickDraw version of the routine, you can get the address of either routine. Either routine can then be replaced, using the SetScriptQDPatchAddress call.

Some printers perform their own text layout on text that is passed to them. Therefore, each QuickDraw patch has two entry points: one for screen display and printing, and one for printing only. By specifying either TRUE or FALSE in the forPrinting parameter, the pointer you obtain is to either the "for printing only" or the "not for printing only" entry point. For example, some script systems might use the "for printing only" entry point to perform extra-fine justification of text on a PostScript printer.

Valid values for the trapNum parameter are listed on page 6-101.

If the specified script system is not enabled, GetScriptQDPatchAddress returns
a NIL pointer.

SEE ALSO
WorldScript I is described in the appendix "Built-in Script Support" in this book.

In order to handle contextual formatting appropriately for each script system, printer drivers should call the Script Manager's print action routine, described in Inside Macintosh: Devices.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996