Appearance
COLR table
Defines multi-colored glyphs using layered glyph references (v0) or a full paint graph (v1).
Scope
- Format family: Shared SFNT
- Table tag in JSON:
COLR
Specs
- https://learn.microsoft.com/en-us/typography/opentype/spec/colr
- 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": {
"COLR": {
"baseGlyphRecords": null,
"layerRecords": null,
"version": 0,
"baseGlyphPaintRecords": null,
"layerPaints": null,
"clipList": null,
"varIndexMap": null,
"itemVariationStore": null,
"_checksum": 0
}
}
}Top-level Fields
baseGlyphRecords- implementation-definedlayerRecords- implementation-definedversion- number (0..65535) [spec type:uint16] (0)baseGlyphPaintRecords- implementation-definedlayerPaints- implementation-definedclipList- implementation-definedvarIndexMap- implementation-defineditemVariationStore- implementation-defined
Validation Constraints
version = 0: use parsedbaseGlyphRecordsandlayerRecords.version >= 1: this implementation preserves v1 paint graph data as_v1RawBytesfor round-trip safety.- For v0 data, each BaseGlyphRecord's
firstLayerIndex/numLayersshould reference valid ranges insidelayerRecords. paletteIndexentries in layers should be valid for the active CPAL palette entry count.
Authoring Example
json
{
"tables": {
"COLR": {
"version": 0,
"baseGlyphRecords": [
{ "glyphID": 100, "firstLayerIndex": 0, "numLayers": 2 }
],
"layerRecords": [
{ "glyphID": 101, "paletteIndex": 0 },
{ "glyphID": 102, "paletteIndex": 1 }
],
"_checksum": 0
}
}
}Additional Nested Keys Seen In Implementation
glyphIDfirstLayerIndexnumLayerspaletteIndexbaseGlyphPaintRecordslayerPaintsclipListvarIndexMapitemVariationStore
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.