Microsoft Typography | Developer information | Specifications
OpenType development intro | Encoding | Client support | Suggested glyphs | Tools


The OpenType Layout model provides a powerful architecture for supporting complex scripts and advanced typography. The infrastructure has three components:

  • A publicly specified file format that supports advanced typographic layout information (OpenType)
  • Windows Operating System Services that produce "shaped" and positioned glyph strings from character strings (RichEdit and Uniscribe, the Unicode Script Processor)
  • A freely available, cross-platform, library for low-level access to layout information and layout operations (OpenType Layout Services Library)

The OpenType font format

OpenType fonts may contain either TrueType outlines, or PostScript outlines. The fonts are Unicode-based, and allow a rich mapping between characters and glyphs. This enables support for ligatures, positional forms, alternates, and other substitutions. OpenType fonts also may include information that supports two-dimensional glyph positioning and glyph attachment.

Layout features within OpenType fonts, are organized by scripts and languages. Thus allowing a single font to support multiple writing systems, even within the same script.

OpenType fonts are not dependent on a single character-encoding scheme, and in fact the format supports all the encoding schemes in common use today. Internally, however, all OpenType fonts are "plumbed" with Unicode.

Windows operating system services

The Windows Operating System provides service libraries that assist applications in text-layout operations. Many Microsoft applications now use these libraries, which provide consistency, save development time, and insulate product developers from many complex script issues. These libraries are publicly exposed as a part of the operating system, documented in the Windows SDK, and are governed by the same licensing restrictions as the rest of the operating system.

Although any text-layout client may use these services to perform the bulk of text-layout, the interfaces are also designed to allow clients to use the services to augment the operation of their own proprietary text-engines.

Unicode script processor

The Unicode Script Processor (USP10.DLL) is a collection of API's that enable a text-layout client to format complex scripts. The Unicode Script Processor, also referred to as "Uniscribe," supports the complex rules found in scripts such as Arabic, Indian, and Thai. Uniscribe also handles scripts written from right-to-left, such as Arabic or Hebrew, and supports the mixing of scripts.

Uniscribe is composed of multiple "shaping engines." These shaping engines contain the layout knowledge for particular scripts (for example, Arabic, Hebrew, Thai, Hindi, Tamil). In addition, there is an OpenType Layout shaping engine for handling script features unknown to Uniscribe. Uniscribe provides character-to-glyph mapping; dx,dy positioning; line breaking at word boundaries; hit testing and cursor positioning.

Uniscribe subdivides strings of characters into "items" (a character string having all the same script and direction attributes), "runs" (portions of an item that have continuous formatting attributes), and clusters (script-defined, indivisible character groupings). A client builds runs based on its own stored formatting attributes, and on the item boundaries obtained from Uniscribe.

Using Uniscribe, clients need only manage a backing store of Unicode character codes, typed by the user in "logical order" (as defined by Unicode). Text-layout clients do not need to maintain any other buffer or mapping table to track character order, and the backing store never changes as a result of layout operations.

Clients of Uniscribe include: Win32 API's, plain text applets, edit controls, RichEdit 3.0, Wordpad, Office9, Internet Explorer E4.0+, FrontPage Express, Outlook Express. USP10.DLL (the Uniscribe library) ships with Windows 2000, Internet Explorer v.4.0cs and greater. USP10.DLL may also be used on NT4, Windows 95 and Windows 98 systems.


RichEdit is a higher-level collection of interfaces that may be used to call Uniscribe, or other shaping engines or routines. RichEdit serves to further insulate text-layout clients from the complexities of certain scripts.

RichEdit 3.0 provides fast, versatile editing of rich Unicode multilingual text and simple plain text. RichEdit includes extensive message and COM interfaces. RichEdit features include text editing, formatting, line breaking, simple table layout, vertical text layout, bidirectional text layout, Indic and Thai support, a Word edit UI, and Text Object Model Interfaces.

RichEdit is the simplest way for a client to support features of complex scripts. Clients use the TextOut function of RichEdit to automatically parse, shape, position, and break lines.

RichEdit is designed for clients whose primary purpose is not necessarily text layout, but who nonetheless need to display complex scripts.

The OpenType layout services library (OTLS)

The OTLS is a set of text-processing helper functions. The services simplify the job of text processing by insulating a client application from the details of the font file format. The services library is freely available under license from Microsoft, and will ultimately be distributed with the operating system.

Although any text-layout client may use these services to perform the bulk of text-layout, the interfaces are also designed to allow clients to use the services to augment the operation of their own proprietary text-engines.

The OTLS allow clients to work at the level of features and characters, with which clients are already familiar. The OTLS handle the details of lookup tables and glyph ID's, with which clients are not familiar.

The simplest way for a client to use the OTLS is to identify sections of text with OTLS features and to use the text layout functions for all text-processing operations. In this approach, the client is still responsible for deciding where to break lines, whether to do justification, and whether to layout text in a device dependent or device independent fashion.

A more sophisticated client may directly manipulate the data structures of the text, enabling the client to manage glyph substitution or positioning. Sophisticated clients may also choose to intercept or replace resource management calls in order to handle memory allocation or access font tables.

The OTLS can be used as a set of shareable functions (as a DLL), or they may be used indirectly by applications calling Uniscribe or RichEdit.

this page was last updated 21 December 2001
© 2001 Microsoft Corporation. All rights reserved. Terms of use.
comments to the MST group: how to contact us


OpenType development intro | Encoding | Client support | Suggested glyphs | Tools
Microsoft Typography | Developer information | Specifications