Important: The information in this document is obsolete and should not be used for new development.
The Script Manager and Applications
The Script Manager is your application's principal interface--either direct or indirect--with any of the script systems that may be available on the user's computer. For many text-related tasks, the Script Manager's role is transparent; when you make a script-aware Text Utilities or QuickDraw call while processing text, that routine may get the information it needs through the Script Manager. For example, when you call the QuickDraw procedureDrawText
to draw a line of text,DrawText
in turn calls the Script Manager to determine which script system your text belongs to before drawing it.In other situations you may need to call the Script Manager explicitly, to properly interpret the text you are processing. Those situations are the principal subject of this chapter.
The Script Manager provides services that fall into four general categories: controlling settings, obtaining information, modifying text, and modifying script systems. Any text-handling application that you write, unless it relies solely on TextEdit, will need to use some of those services. Almost any text application, for example, needs to call the
GetScriptManagerVariable
function. Other calls are for specialized programs only. TheIntlTokenize
function, for example, is only for specialized programs that parse highly structured text such as source code, mathematical expressions, or formatted numbers.These are the services provided by the Script Manager in each of the four categories:
- Controlling settings. The routines in this category are of general interest and are used by most text applications. With these routines you can
- check and set the system direction, a global variable that controls the default alignment of text and can affect the order in which blocks of mixed-directional text are drawn.
- check and set Script Manager variables, private variables used by the Script Manager to keep track of information that is general to the text environment.
- check and set script variables, private variables used by script systems to keep track of their own configurations.
- make keyboard settings that affect text input, so that users can enter text in any script system and you can display it properly.
- Obtaining information. Many of the routines in this category are of general interest and are used by most text applications. With these routines you can
- determine script codes from font information. Most applications need this information.
- analyze characters for size (in bytes) and type. Applications that work with 2-byte script systems need size information, and many applications need character-type information.
- directly access a script system's international resources. Most applications need this information only to pass it to other routines. Some applications also use it to inspect or modify individual tables or other data within a resource.
- Converting text. The routines in this category are used by specialized applications only. (Text-modification routines of general interest to applications are described in the chapter "Text Utilities" in this book.) With these routines you can
- tokenize text: convert source text from any script system into script-independent tokens.
- transliterate text: phonetically convert text from one subscript to another within a script system.
- Modifying script systems. The routines in this category are used for specialized purposes, such as providing regional variants to existing script systems or assigning script-specific features to individual documents or applications. With these routines you can