Important: The information in this document is obsolete and should not be used for new development.
GetScriptQDPatchAddress
TheGetScriptQDPatchAddress
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. IfFALSE
, 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; ifFALSE
, 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
TheGetScriptQDPatchAddress
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
orFALSE
in theforPrinting
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
aNIL
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.