Share via


Displaying Text with Uniscribe (Windows CE 5.0)

Send Feedback

The following procedure is performed for each line. The procedure assumes that the text has already been laid out using Uniscribe, and that the glyphs and positions from the layout process were not saved. If speed is a concern, an application can save the glyphs and positions from the layout procedure and start at Step 2.

To Display Text Using Uniscribe

  1. For each run, in the following order:

    1. If the style has changed since the last run, update the hdc.
    2. Call ScriptShape to generate glyphs for the run.
    3. Call ScriptPlace to generate an advance width and an x,y offset for each glyph.
  2. Establish the correct visual order for the runs in this line:

    1. Extract an array of bidirectional embedding levels, one per run, from the merged item and run information. The embedding level is given by (SCRIPT_ITEM) si.(SCRIPT_ANALYSIS) a. (SCRIPT_STATE) s.uBidiLevel.
    2. Pass this array to ScriptLayout to generate a map of visual to logical positions.
  3. To justify the text, call ScriptJustify. For more sophisticated justification, an application can also generate an updated delta dx array using its own language knowledge and the information returned by ScriptShape in the SCRIPT_VISATTR array. For more information, see Related Processing for Complex Scripts.

    Note   This step is optional.

  4. Use the visual to logical map to display the runs in visual order. Starting at the left end of the line, call ScriptTextOut to display the run given by the first entry in the visual to logical map. For each subsequent entry in the visual to logical map, call ScriptTextOut to display the indicated run to the right of the previously displayed run.

Note   You may omit Step 2 if the text contains no characters from right-to-left scripts, contains no bidirectional control characters, and the base embedding level is left-to-right. In this case, Step 4 changes to the following procedure: Start at the left end of the line and call ScriptTextOut to display the first logical run and then to display each logical run to the right of the previous run.

See Also

Text Display with Uniscribe

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.