Important: The information in this document is obsolete and should not be used for new development.
MyRlDirProc
TheMyRlDirProc
function is a callback routine that you supply for use by theGetFormatOrder
procedure. TheMyRlDirProc
function is a Boolean function that calculates, for a style run identified by number, the direction of that style run. Your routine returnsTRUE
for right-to-left text direction,FALSE
for left-to-right.MyRlDirProc
is pointed to by therlDirProc
parameter ofGetFormatOrder
.
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 (typeFormatOrder
) for style runs on a line, theGetFormatOrder
procedure callsMyRlDirProc
for each style run numbered fromfirstFormat
tolastFormat
.GetFormatOrder
passesMyRlDirProc
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. GivendirParam
and a style run identifier, the application-definedMyRlDirProc
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 forGetFormatOrder
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.