This procedure assumes that the application has already divided the paragraph into runs.
To Lay Out Text Using Uniscribe
Call ScriptRecordDigitSubstitution only when the application starts, or when receiving a WM_SETTINGCHANGE message.
Call ScriptIsComplex to determine if the paragraph requires complex processing.
Note This step is optional.
For automatic digit substitution, call ScriptApplyDigitSubstitution to prepare the SCRIPT_CONTROL and SCRIPT_STATE structures in ScriptItemize. If the application does its own reordering and layout, it must substitute the proper digits for Unicode U+0030 through U+0039 (the Western digits).
Call ScriptItemize to divide the paragraph into items. If an application already knows the bidirectional order -- for example, because of the keyboard layout used to enter the character -- it can call ScriptItemize with NULL for the SCRIPT_CONTROL and SCRIPT_STATE parameters. The application can then reorder the items using its information.
Merge the item information with the run information to produce runs with a single style, script, and direction.
Call ScriptGetCMap to assign a font to a run and get glyphs. If some glyphs are not supported by the font, either substitute another font or set the eScript member to SCRIPT_UNDEFINED.
Note If a font renders a code point by a combination of glyphs instead of a single glyph, this method may indicate that the code point is unsupported. In this case, call ScriptShape, check for an S_OK return code, and then check the output for missing glyphs.
Call ScriptShape to identify clusters and generate glyphs.
Call ScriptPlace to generate advance widths and x and y positions for the run width.
Sum the run widths until the line overflows.
Break the run on a word boundary by using the fSoftBreak and fWhiteSpace members in the logical attributes. To break a single character cluster off the run, use the information returned by calling ScriptBreak.
See Also
Text Display with Uniscribe | System Information Messages
Send Feedback on this topic to the authors