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 3 - QuickDraw Text / QuickDraw Text Reference
Application-Supplied Routine /


MyRlDirProc

The MyRlDirProc function is a callback routine that you supply for use by the GetFormatOrder procedure. The MyRlDirProc function is a Boolean function that calculates, for a style run identified by number, the direction of that style run. Your routine returns TRUE for right-to-left text direction, FALSE for left-to-right. MyRlDirProc is pointed to by the rlDirProc parameter of GetFormatOrder.

FUNCTION MyRlDirProc (theFormat: Integer; 
                      dirParam: Ptr): Boolean;
theFormat
A value that identifies the style run whose direction is needed.
dirParam
A pointer to an application-defined parameter block that contains the font and script information for each style run in the text. The contents of this parameter block are used to determine the direction of the style run. Because of the relationship between the font family ID and the script code, the font family ID can be used to determine the text direction.
DESCRIPTION
To fill the ordering array (type FormatOrder) for style runs on a line, the GetFormatOrder procedure calls MyRlDirProc for each style run numbered from firstFormat to lastFormat. GetFormatOrder passes MyRlDirProc a number identifying the style run in storage order, and a pointer to the parameter information block, dirParam, that contains the font and style information for the style run. Given dirParam and a style run identifier, the application-defined MyRlDirProc routine should be able to determine the style run direction.

You should store your style run information in a way that makes it convenient for MyRLDirProc. One obvious way to do this is to declare a record type for style runs that allows you to save things like font style, font family ID, script number, and so forth. You then can store these records in an array. When the time comes for GetFormatOrder to fill the ordering array, MyRlDirProc can consult the style run array for direction information for each of the numbered style runs in turn.

For more information, see "GetFormatOrder" on page 3-84.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996