Lookup Type 6:
MarkToMark Attachment Positioning Subtable

The MarkToMark attachment (MarkMarkPos) subtable is identical in form to the MarkToBase attachment subtable, although its function is different. MarkToMark attachment defines the position of one mark relative to another mark as when, for example, positioning tone marks with respect to vowel diacritical marks in Vietnamese.

The attaching mark is Mark1, and the base mark being attached to is Mark2. In the MarkMarkPos subtable, every Mark1 glyph has an anchor attachment point and is associated with a class of marks. Each Mark2 glyph defines an anchor point for each class of marks. For example, assume two Mark1 classes: all marks positioned to the left of Mark2 glyphs (Class 0), and all marks positioned to the right of Mark2 glyphs (Class 1). Each Mark2 glyph that uses these marks defines two anchor points: one for attaching the Mark1 glyphs listed in Class 0, and one for attaching the Mark1 glyphs listed in Class 1.

To identify the Mark2 glyph that combines with a Mark1 glyph, the text-processing client must move backward in the glyph string order from the Mark1 glyph to the preceding mark, which becomes Mark2. Aligning the attachment points combines the mark glyphs.

The MarkToMark attachment subtable has one format: MarkMarkPosFormat1. The subtable begins with a format identifier (PosFormat) and offsets to two Coverage tables: one that lists all the Mark1 glyphs referenced in the subtable (Mark1Coverage), and one that lists all the Mark2 glyphs referenced in the subtable (Mark2Coverage).

For each mark glyph in the Mark1Coverage 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. (For details about classes, see the chapter, Common Table Formats.) ClassCount specifies the total number of distinct mark classes defined in all the MarkRecords.

The MarkMarkPosFormat1 subtable also contains two offsets, measured from the beginning of the subtable, to two arrays:

The MarkArray table contains all MarkRecords stored by Mark1Coverage Index in an array (MarkRecord). The MarkArray table also contains a count of the number of defined MarkRecords (MarkCount).

The Mark2Array table consists of an array (Mark2Record) and count (Mark2Count) of Mark2Records.

For details about MarkArrays and MarkRecords, see the end of this chapter.

MarkMarkPosFormat1 subtable: MarkToMark attachment

Type

Name

Description

uint16

PosFormat

Format identifier

—format = 1

Offset

Þ Mark1Coverage

Offset to Combining Mark Coverage table

—from beginning of MarkMarkPos subtable

Offset

Þ Mark2Coverage

Offset to Base Mark Coverage table

—from beginning of MarkMarkPos subtable

uint16

ClassCount

Number of Combining Mark classes defined

Offset

Þ Mark1Array

Offset to MarkArray table for Mark1

—from beginning of MarkMarkPos subtable

Offset

Þ Mark2Array

Offset to Mark2Array table for Mark2

—from beginning of MarkMarkPos subtable


The Mark2Array, shown next, contains one Mark2Record for each Mark2 glyph listed in the Mark2Coverage table. It stores the records in the same order as the Mark2Coverage Index.

Mark2Array table

Type

Name

Description

uint16

Mark2Count

Number of Mark2 records

struct

Mark2Record

Array of Mark2 records

[Mark2Count]

—in Coverage order


Each Mark2Record contains an array of offsets to Anchor tables (Mark2Anchor). The array of zero-based offsets, measured from the beginning of the Mark2Array table, defines the entire set of Mark2 attachment points used to attach Mark1 glyphs to a specific Mark2 glyph. The Anchor tables in the Mark2Anchor array are ordered by Mark1 class value.

A Mark2Record declares one Anchor table for each mark class (including Class 0) identified in the MarkRecords of the MarkArray. Each Anchor table specifies one Mark2 attachment point used to attach all the Mark1 glyphs in a particular class to the Mark2 glyph.

Example 9 at the end of the chapter shows a MarkMarkPosFormat1 subtable for attaching one mark to another in the Arabic script.

Mark2Record

Type

Name

Description

Offset

Þ Mark2Anchor

Array of offsets (one per class) to Anchor tables

[ClassCount]

—from beginning of Mark2Array table

—zero-based array