Shaping Engines (Windows Embedded CE 6.0)

1/6/2010

Uniscribe uses multiple shaping engines that contain the layout knowledge for particular scripts. It also takes advantage of the Microsoft OpenType layout shaping engine for handling font–specific script features such as glyph generation, extent measurement, and word–breaking support.

Uniscribe manages bidirectional character reordering, using the Unicode bidirectional algorithm, and handles non–OpenType layout font formats for Arabic, Hebrew, and Thai shaping.

The exact code–point ranges assigned to each shaping engine may vary, so with the exception of SCRIPT_ UNDEFINED, script numbers are not published. However, you can test the attributes of scripts by calling the ScriptGetProperties function, which accesses the global script properties table. Applications may use the global script properties to help combine their own layout rules with the required shaping engine divisions.

All the complex script shaping engines validate the font in the hdc before shaping, and will return USP_E_SCRIPT_NOT_IN_FONT if the font does not contain sufficient glyphs or shaping tables. Only scripts that have the fComplex property should be shaped with the script returned by the ScriptItemize function. All other runs may be merged and shaped with SCRIPT_UNDEFINED specified in the SCRIPT_ANALYSIS structure.

If the font does not support particular characters, SCRIPT_UNDEFINED does not fail with USP_E_SCRIPT_ NOT_IN_FONT. Instead, missing glyphs will usually be displayed as an empty rectangle.

An application can determine if a code point is supported by a font by calling the ScriptGetFontProperties function to obtain the default glyph index, and the ScriptGetCMap function to look up font glyphs for Unicode code points. However, some codepoints can be rendered by a combination of glyphs — for example, 00C9; LATIN CAPITAL LETTER E WITH ACUTE.

In this example, if a font supports the capital E glyph and the acute glyph, but not a single glyph for 00C9, ScriptGetCMap will indicate that 00C9 is unsupported. To reliably determine the font support for a string that contains these kinds of code points, call ScriptShape. If it returns S_OK, check the output for missing glyphs.

See Also

Other Resources

Uniscribe Application Development