Platform SDK: International Features

Processing Complex Scripts

The following are options for processing complex scripts:

The options you choose will depend on the following factors:

In general, an application that does relatively simple script processing can choose any option. However, for the most complete control of complex script processing, Uniscribe is recommended.

Text Functions

Applications that work mostly in plain text--that is, text that uses the same typeface, weight, color, and so on--have traditionally written text and measured line lengths using standard Microsoft® Win32® text functions, such as TextOut, ExtTextOut, TabbedTextOut, DrawText, and GetTextExtentExPoint. Starting with Microsoft® Windows® 2000, these functions have been extended to support complex scripts. In general, this support is transparent to the application. However, applications should save characters in a buffer and display the whole line of text at one time rather than, for example, calling ExtTextOut on each character as it is typed in by the user. This allows the complex script shaping modules to use context to reorder and generate glyphs correctly. Also, applications should use GetTextExtentExPoint to determine line length rather than computing line lengths from cached character widths. This is because the width of a glyph may vary by context. In addition, complex script-aware applications should consider adding support for right-to-left reading order and right alignment to their applications.

For more information, see Fonts and Text.

Edit Controls

The standard edit controls have been extended to support multilingual text and complex scripts. This includes not only input and display, but also correct cursor movement over character clusters (in Thai and Devanagari script, for example).

For more information, see Edit Controls.

Rich Edit Controls

Rich Edit 3.0 is a higher-level collection of interfaces that takes advantage of Uniscribe to further insulate text layout clients from the complexities of certain scripts. Rich Edit is designed for clients whose primary purpose is not necessarily text layout, but who nonetheless need to display complex scripts.

Rich Edit provides fast, versatile editing of rich Unicode multilingual text and simple plain text. It includes extensive message and COM interfaces, text editing, formatting, line breaking, simple table layout, vertical text layout, bidirectional text layout, Indic and Thai support, an editing UI much like Microsoft Word, and Text Object Model interfaces. Rich Edit is the simplest way for a client to support features of complex scripts. Clients use its TextOut function to automatically parse, shape, position, and break lines.

For more information, see Rich Edit Controls.

Uniscribe

Uniscribe enables extremely fine processing of complex scripts. It supports the complex rules found in scripts such as Arabic, Indian, and Thai. It also handles scripts written from right to left, such as Arabic and Hebrew, and supports the mixing of scripts. The rest of this section deals with Uniscribe.