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 /
Appendix A - Built-in Script Support / WorldScript II


About WorldScript II

The 2-byte script systems developed prior to system software version 7.1 contain their own code to handle language-specific text processing. Each also has its own initialization and configuration code, installing itself at startup and adding its own modifications to the system. Each script system patches three different areas of system software: QuickDraw, the Event Manager, and the script management system. This can result in a layering of patches to the same traps, inconsistent behavior, and inefficient use of memory.

WorldScript II, working with the Text Services Manager and other parts of system software, eliminates code duplication and provides for the special text-input needs of the 2-byte systems:

WorldScript II redefines what a 2-byte script system consists of. WorldScript II combines the executable code for many routines for all 2-byte script systems. Script-specific behavior is encoded in resource-based tables. This reduces memory requirements for multiscript systems and avoids layering of patches.

Shared Script Utilities

WorldScript II contains the code for all script utilities. Script-specific behavior is determined by tables in each script's international resources. In a multiscript environment, WorldScript II loads only one copy of its code into memory. Furthermore, the user needs only the WorldScript II file in the Extensions folder, rather than one extension file per script system. This eases memory requirements and saves disk space.

Table A-11 lists the script utilities implemented by WorldScript II, along with the chapters in this book that describe their corresponding high-level routines.
Table A-15 Script utilities supported by WorldScript II (Continued)
Script utilityChapter in this book 
CharacterByteTypeScript Manager 
CharacterTypeScript Manager 
CharToPixelQuickDraw Text 
DrawJustifiedQuickDraw Text 
FillParseTableScript Manager 
FindScriptRun[11]Text Utilities 
FindWordBreaks[11]Text Utilities 
GetScriptVariable[12]Script Manager 
HiliteTextQuickDraw Text 
MeasureJustifiedQuickDraw Text 
PixelToCharQuickDraw Text 
PortionLineQuickDraw Text 
SetScriptVariable[12]Script Manager 
TransliterateTextScript Manager 
VisibleLengthQuickDraw Text 
WorldScript II supports the following script utilities for backward compatibility. They call newer versions of themselves to handle their tasks. They are: Pixel2Char (calls PixelToChar), Char2Pixel (calls CharToPixel), DrawJust (calls DrawJustified), MeasureJust (calls MeasureJustified), PortionText (calls PortionLine), CharByte (calls CharacterByteType), CharType (calls CharacterType), ParseTable (calls FillParseTable), Transliterate (calls TransliterateText).

Table-Based Script Behavior

Script-specific text behavior is controlled by tables in each script system's international resources. The encoding/rendering resource (type 'itl5') contains character encoding information, and the transliteration resource (type 'trsl') contains information for character conversion among subscripts of a 2-byte script.

For example, the byte-type table in a script's encoding/rendering resource typically contains information about the type of a specific byte in the range of $00-$FF--whether it can be the high-order byte of a 2-byte character, the low-order byte of a 2-byte character, or a 1-byte character. The character-type table in the same resource gives more detailed information about a character in a particular coding scheme.

Currently, there are two transliteration formats used by WorldScript II and supported by tables in a script's transliteration resource. One of them is used to transliterate Jamo to Hangul (and Hangul to Jamo) in the Korean system. The other is a more general rule-based transliteration. You cannot customize the Jamo-to-Hangul transliteration. You can customize the rule-based transliteration by supplying the proper tables in a transliteration resource.

The encoding/rendering resource and the transliteration resource are described in the appendix "International Resources" in this book.


[11] The Script Manager handles these routines directly if the necessary tables are in the script's 'itl2' resource. Otherwise, they are passed to WorldScript II.
[12] The Script Manager handles these routines directly if the standard selectors documented in this book are used. The routines are passed to WorldScript II if private selectors are used.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996