Important: The information in this document is obsolete and should not be used for new development.
SetScriptQDPatchAddress
TheSetScriptQDPatchAddress
procedure replaces the WorldScript I specified QuickDraw patch--or the built-in QuickDraw call--for the given script.
PROCEDURE SetScriptQDPatchAddress (trapNum: Integer; before: Boolean; forPrinting: Boolean; routineAddr: Ptr; script: ScriptCode);
trapNum
- A value that specifies the name of the QuickDraw routine that is to
be replaced.before
- A Boolean that specifies which of two routines is to be replaced. If
TRUE
, the WorldScript I patch of the QuickDraw routine is replaced.
IfFALSE
, the original routine (usually the built-in QuickDraw routine)
is replaced.forPrinting
- A Boolean that specifies whether the replacement routine is for printing. If
TRUE
, the new QuickDraw patch is specifically for printing; ifFALSE
, the new QuickDraw patch is not specifically for printing.routineAddr
- A pointer to the routine that is to replace the existing QuickDraw routine.
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
TheSetScriptQDPatchAddress
procedure replaces the pointer to the desired routine in the specified script's dispatch table.All of the WorldScript I patches call the original QuickDraw routine after they execute. Each element in the dispatch table consists of a pair of addresses: one for the WorldScript I patch, and another for the original (built-in QuickDraw) version of the routine. With SetQDPatchAddress you can replace either routine. Thus you can insert your patch code either before (or in place of) the WorldScript I QuickDraw patch, or before (or in place of) the original QuickDraw routine.
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 one for printing only. By specifying either
TRUE
orFALSE
in theforPrinting
parameter, you specify whether you are passing 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
- IMPORTANT
- When you patch a script system's QuickDraw call, you alter that script's behavior for as long as it remains enabled. Therefore, be sure to restore the pointer to its original state whenever your application quits or is switched out by the Process Manager.
trapNum
parameter are listed on page 6-101.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.