Table Organization

The GPOS table begins with a header that defines offsets to a ScriptList, a FeatureList, and a LookupList (see Figure 4f):

The ScriptList identifies all the scripts and language systems in the font that use glyph positioning.

The FeatureList defines all the glyph positioning features required to render these scripts and language systems.

The LookupList contains all the lookup data needed to implement each glyph positioning feature.

For a detailed discussion of ScriptLists, FeatureLists, and LookupLists, see the chapter, Common Table Formats. The following discussion summarizes how the GPOS table works.

Figure 4f. High-level organization of GPOS table

The GPOS table is organized so text processing clients can easily locate the features and lookups that apply to a particular script or language system. To access GPOS information, clients should use the following procedure:

Locate the current script in the GPOS ScriptList table.

If the language system is known, search the script for the correct LangSys table; otherwise, use the script's default language system (DefaultLangSys table).

The LangSys table provides index numbers into the GPOS FeatureList table to access a required feature and a number of additional features.

Inspect the FeatureTag of each feature, and select the features to apply to an input glyph string.

Each feature provides an array of index numbers into the GPOS LookupList table. Lookup data is defined in one or more subtables that contain information about specific glyphs and the kinds of operations to be performed on them.

Assemble all lookups from the set of chosen features, and apply the lookups in the order given in the LookupList table.

A lookup uses subtables to define the specific conditions, type, and results of a positioning action used to implement a feature. All subtables in a lookup must be of the same LookupType, as listed in the LookupType Enumeration table:

LookupType Enumeration table for glyph positioning

Value

Type

Description

1

Single adjustment

Adjust position of a single glyph

2

Pair adjustment

Adjust position of a pair of glyphs

3

Cursive attachment

Attach cursive glyphs

4

MarkToBase attachment

Attach a combining mark to a base glyph

5

MarkToLigature attachment

Attach a combining mark to a ligature

6

MarkToMark attachment

Attach a combining mark to another mark

7

Context positioning

Position one or more glyphs in context

8+

Reserved

For future use


Each LookupType is defined by one or more subtables, whose format depends on the type of positioning operation and the resulting storage efficiency. When glyph information is best presented in more than one format, a single lookup may define more than one subtable, as long as all the subtables are of the same LookupType. For example, within a given lookup, a glyph index array format may best represent one set of target glyphs, whereas a glyph index range format may be better for another set.

A series of positioning operations on the same glyph or string requires multiple lookups, one for each separate action. Each lookup is given a different array number in the LookupList table and is applied in the LookupList order.

During text processing, a client applies a lookup to each glyph in the input string, starting with the first glyph, before moving to the next lookup. To apply a lookup, the client searches the subtables in the order they are defined in the lookup. If the first subtable does not contain data relevant to the glyph, the client searches the next subtable, and so on. If the client finds glyph data, it adjusts the glyph position.

A lookup is finished for a glyph when the client repositions a glyph or when the client finds no relevant data in any of the subtables defined in the lookup. The client then advances to the next glyph in the glyph string and begins the lookup process again.

This rest of this chapter describes the GPOS header and the subtables defined for each LookupType. Several GPOS subtables share other tables: ValueRecords, Anchor tables, and MarkArrays. For easy reference, the shared tables are described at the end of this chapter.