LookupType 2: Multiple Substitution Subtable

A Multiple Substitution (MultipleSubst) subtable replaces a single glyph with more than one glyph, as when multiple glyphs replace a single ligature. The subtable has a single format: MultipleSubstFormat1. The subtable specifies a format identifier (SubstFormat), an offset to a Coverage table that defines the input glyph indices, a count of offsets in the Sequence array (SequenceCount), and an array of offsets to Sequence tables that define the output glyph indices (Sequence). The Sequence table offsets are ordered by the Coverage Index of the input glyphs.

For each input glyph listed in the Coverage table, a Sequence table defines the output glyphs. Each Sequence table contains a count of the glyphs in the output glyph sequence (GlyphCount) and an array of output glyph indices (Substitute).

Note: The order of the output glyph indices depends on the writing direction of the text. For text written left to right, the left-most glyph will be first glyph in the sequence. Conversely, for text written right to left, the right-most glyph will be first.

If the glyph should be deleted, the GlyphCount is set to zero, and no Substitute array is allocated.

Example 4 at the end of this chapter shows how to replace a single ligature with three glyphs.

MultipleSubstFormat1 subtable: Multiple output glyphs

Type

Name

Description

uint16

SubstFormat

Format identifier

 

 

—format = 1

Offset

Coverage

Offset to Coverage table

 

 

—from beginning of Substitution table

uint16

SequenceCount

Number of Sequence table offsets in the Sequence array

Offset

Sequence

Array of offsets to Sequence tables

 

[SequenceCount]

—from beginning of Substitution table

 

 

—ordered by Coverage Index


Sequence table

Type

Name

Description

uint16

GlyphCount

Number of GlyphIDs in the Substitute array

 

 

—to indicate glyph deletion, set to zero (0)

GlyphID

Substitute[GlyphCount]

String of GlyphIDs to substitute

 

 

—ordered according to LookupFlag direction bit