Appearance
GPOS table
Defines glyph positioning rules — kerning, mark placement, cursive attachment, and other adjustments.
GPOS PairPos (lookupType 2) is the modern standard for kerning. Font Flux extracts PairPos kerning into the simplified kerning[] array and can build GPOS PairPos from kerning data on export. See Creating Kerning for the full authoring guide.
Scope
- Format family: Shared SFNT
- Table tag in JSON:
GPOS
Specs
- https://learn.microsoft.com/en-us/typography/opentype/spec/gpos
- OpenType table registry: https://learn.microsoft.com/en-us/typography/opentype/spec/otff#font-tables
JSON Skeleton
This skeleton reflects fields currently parsed/written by Font Flux JS for this table.
json
{
"tables": {
"GPOS": {
"majorVersion": 0,
"minorVersion": 0,
"_checksum": 0
}
}
}Top-level Fields
majorVersion- number (0..65535)minorVersion- number (0..65535)
Nested JSON Structure
Top-level layout (shared OpenType Layout container):
json
{
"majorVersion": 1,
"minorVersion": 1,
"scriptList": { "scriptRecords": [] },
"featureList": { "featureRecords": [] },
"lookupList": {
"lookups": [
{
"lookupType": 1,
"lookupFlag": 0,
"subtables": [
{
"format": 1,
"coverage": { "format": 1, "glyphArray": [10, 11] },
"valueFormat": 5,
"valueRecord": { "xPlacement": 20, "xAdvance": 30 }
}
]
}
]
},
"featureVariations": { "featureVariationRecords": [] }
}Lookup subtable families by lookupType:
1SinglePos:valueFormat+valueRecordorvalueRecords[].2PairPos: eitherpairSets[](format 1) or class-basedclass1Records(format 2).3CursivePos:entryExitRecords[]withentryAnchor/exitAnchor.4MarkBasePos:markArray+baseArray.5MarkLigPos:markArray+ligatureArray.6MarkMarkPos:mark1Array+mark2Array.7ContextPos and8ChainedContextPos: shared Sequence/ChainedSequence context structures.9ExtensionPos: wraps another positioning subtable insubtablewithextensionLookupType.
Validation Constraints
majorVersionis typically1.minorVersion >= 1may includefeatureVariations.- Each lookup's
lookupTypemust match the subtable shapes it contains. - ValueRecord fields must match
valueFormatbits (for Single/Pair positioning subtables). - Practical dependency: keep
GDEFpresent when using mark attachment lookups (types 4, 5, 6).
Authoring Example
json
{
"tables": {
"GPOS": {
"majorVersion": 1,
"minorVersion": 0,
"scriptList": { "scriptRecords": [] },
"featureList": { "featureRecords": [] },
"lookupList": { "lookups": [] },
"_checksum": 0
}
}
}Additional Nested Keys Seen In Implementation
markClassmarkAnchorscriptListfeatureListlookupListfeatureVariationsentryAnchorexitAnchorsubtablescoverageformatglyphspairSetsentryexit
Notes
- Preserve
_checksumfor stable round-tripping. - If a table is only partially understood, prefer keeping unknown bytes in
_rawinstead of dropping data. - Validate with
.validate()after edits.