次の方法で共有


Laying Out Text with Uniscribe (Windows Embedded CE 6.0)

1/6/2010

This procedure assumes that the application has already divided the paragraph into runs.

To Lay Out Text Using Uniscribe

  1. Call ScriptRecordDigitSubstitution only when the application starts, or when receiving a WM_SETTINGCHANGE message.

  2. (Optional) Call ScriptIsComplex to determine if the paragraph requires complex processing.

  3. 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).

  4. 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.

  5. Merge the item information with the run information to produce runs with a single style, script, and direction.

  6. 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.

  7. Call ScriptShape to identify clusters and generate glyphs.

  8. Call ScriptPlace to generate advance widths and x and y positions for the run width.

  9. Sum the run widths until the line overflows.

  10. 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

Concepts

Text Display with Uniscribe

Other Resources

System Information Messages