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 5 - Text Utilities / Text Utilities Reference
Routines / Working With Word, Script, and Line Boundaries


FindScriptRun

The FindScriptRun function finds the next block of subscript text within a script run.

FUNCTION FindScriptRun (textPtr: Ptr;
                        textLen: LongInt;
                        VAR lenUsed: LongInt): ScriptRunStatus;
textPtr
A pointer to the text string to be analyzed.
textLen
The number of bytes in the text string.
lenUsed
On output, contains the length, in bytes, of the script run that begins with the first character in the string; this length is always greater than or equal to 1, unless the string passed in is of length 0.
DESCRIPTION
The FindScriptRun function is used to identify blocks of subscript text in a string. Some script systems include subscripts, which are character sets that are subsidiary to the main character set. One useful subscript is the set of all character codes that have the same meaning in Roman as they do in a non-Roman script. For other scripts such as Japanese, there are additional useful subscripts. For example, a Japanese script system might include some Hiragana characters that are useful for input methods.

FindScriptRun computes the length of the current run of subscript text in the text string specified by textPtr and textLen. It assigns the length, in bytes, to the lenUsed parameter and returns a status code. You can advance the text pointer by the value of lenUsed to make subsequent calls to this function. You can use this function to identify runs of subscript characters so that you can treat them separately.

The function result identifies the run as either native text, Roman, or one of the defined subscripts of the script system and returns a record of type ScriptRunStatus. This record is described in the section "The Script Run Status Record" on page 5-46.

Word processors and other applications can call FindScriptRun to separate style runs of native text from non-native text. You can use this capability to extract those characters and apply a different font to them. Figure 5-11 on page 5-28 provides an example of using the FindScriptRun routine.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the FindScriptRun function are
Trap macroSelector
_ScriptUtil$820C 0026


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996