Lookup Type 5:
MarkToLigature Attachment Positioning Subtable

The MarkToLigature attachment (MarkLigPos) subtable is used to position combining mark glyphs with respect to ligature base glyphs. With MarkToBase attachment, described previously, a single base glyph defines an attachment point for each class of marks. In contrast, MarkToLigature attachment describes ligature glyphs composed of several components that can each define an attachment point for each class of marks.

As a result, a ligature glyph may have multiple base attachment points for one class of marks. The specific attachment point for a mark is defined by the ligature component that the subtable associates with the mark.

The MarkLigPos subtable can be used to define multiple mark-to-ligature attachments. In the subtable, every mark glyph has an anchor point and is associated with a class of marks. Every ligature glyph specifies a two-dimensional array of data: each component in a ligature defines an array of anchor points, one for each class of marks.

For example, assume two mark classes: all marks positioned above base glyphs (Class 0), and all marks positioned below base glyphs (Class 1). In this case, each component of a base ligature glyph may define two anchor points, one for attaching the mark glyphs listed in Class 0, and one for attaching the mark glyphs listed in Class 1. Alternatively, if the language system does not allow marks on the second component, the first ligature component may define two anchor points, one for each class of marks, and the second ligature component may define no anchor points.

To position a combining mark using a MarkToLigature attachment subtable, the text-processing client must work backward from the mark to the preceding ligature glyph. To correctly access the subtables, the client must keep track of the component associated with the mark. Aligning the attachment points combines the mark and ligature.

The MarkToLigature attachment subtable has one format: MarkLigPosFormat1. The subtable begins with a format identifier (PosFormat) and offsets to two Coverage tables that list all the mark glyphs (MarkCoverage) and Ligature glyphs (LigatureCoverage) referenced in the subtable.

For each glyph in the MarkCoverage table, a MarkRecord specifies its class and an offset to the Anchor table that describes the mark's attachment point. A mark class is identified by a specific integer, called a class value. ClassCount records the total number of distinct mark classes defined in all MarkRecords.

The MarkBasePosFormat1 subtable contains an offset, measured from the beginning of the subtable, to a MarkArray table, which contains all MarkRecords stored in an array (MarkRecord) by MarkCoverage Index. (For details about MarkArrays and MarkRecords, see the end of this chapter.)

The MarkLigPosFormat1 subtable also contains an offset to a LigatureArray table (LigatureArray).

MarkLigPosFormat1 subtable: MarkToLigature attachment

Type

Name

Description

uint16

PosFormat

Format identifier

—format = 1

Offset

Þ MarkCoverage

Offset to Mark Coverage table

—from beginning of MarkLigPos subtable

Offset

Þ LigatureCoverage

Offset to Ligature Coverage table

—from beginning of MarkLigPos subtable

uint16

ClassCount

Number of defined mark classes

Offset

Þ MarkArray

Offset to MarkArray table

—from beginning of MarkLigPos subtable

Offset

Þ LigatureArray

Offset to LigatureArray table

—from beginning of MarkLigPos subtable


The LigatureArray table contains a count (LigatureCount) and an array of offsets (LigatureAttach) to LigatureAttach tables. The LigatureAttach array lists the offsets to LigatureAttach tables, one for each ligature glyph listed in the LigatureCoverage table, in the same order as the LigatureCoverage Index.

LigatureArray table

Type

Name

Description

uint16

LigatureCount

Number of LigatureAttach table offsets

Offset

Þ LigatureAttach

Array of offsets to LigatureAttach tables

[LigatureCount]

—from beginning of LigatureArray table

—ordered by LigatureCoverage Index


Each LigatureAttach table consists of an array (ComponentRecord) and count (ComponentCount) of the component glyphs in a ligature. The array stores the ComponentRecords in the same order as the components in the ligature. The order of the records also corresponds to the writing direction of the text. For text written left to right, the first component is on the left; for text written right to left, the first component is on the right.

LigatureAttach table

Type

Name

Description

uint16

ComponentCount

Number of ComponentRecords in this ligature

struct

ComponentRecord

Array of Component records

[ComponentCount]

—ordered by LookupFlag direction bit


A ComponentRecord, one for each component in the ligature, contains an array of offsets to the Anchor tables that define all the attachment points used to attach marks to the component (LigatureAnchor). For each mark class (including Class 0) identified in the MarkArray records, an Anchor table specifies the point used to attach all the marks in a particular class to the ligature base glyph, relative to the component.

In a ComponentRecord, the zero-based LigatureAnchor array lists offsets to Anchor tables by mark class. If a component does not define an attachment point for a particular class of marks, then the offset to the corresponding Anchor table will be NULL.

Example 8 at the end of this chapter shows a MarkLisPosFormat1 subtable used to attach mark accents to a ligature glyph in the Arabic script.

ComponentRecord

Type

Name

Description

Offset

Þ LigatureAnchor

Array of offsets (one per class) to Anchor tables

[ClassCount]

—from beginning of LigatureAttach table

—ordered by class

—NULL if a component does not have an attachment for a class

—zero-based array