Important: The information in this document is obsolete and should not be used for new development.
MyRlDirProc
TheMyRlDirProcfunction is a callback routine that you supply for use by theGetFormatOrderprocedure. TheMyRlDirProcfunction is a Boolean function that calculates, for a style run identified by number, the direction of that style run. Your routine returnsTRUEfor right-to-left text direction,FALSEfor left-to-right.MyRlDirProcis pointed to by therlDirProcparameter 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, theGetFormatOrderprocedure callsMyRlDirProcfor each style run numbered fromfirstFormattolastFormat.GetFormatOrderpassesMyRlDirProca 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. GivendirParamand a style run identifier, the application-definedMyRlDirProcroutine 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 forGetFormatOrderto fill the ordering array,MyRlDirProccan 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.