Closed RoelN closed 3 years ago
CoverageFormat 1 has a glyphArray
that is literally just a list of glyph ids, whereas CoverageFormat 2 encodes which glyphs are covered by using the same kind of segments that cmap 4 uses (see https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#coverage-format-2). It calls them "rangeRecords", but just as it's possible (if really silly) for cmap 4 to have segments with the same start and end codes, rangeRecords can be set for only a single glyphid (which is what we see in your log result).
Also note that coverage tables do not point to lookups, it's the other way around: a lookup defines what should happen, for a set of characters. The "what should happen" part is covered by the lookup's subtables, and the "what it applies to" is documented separated by each subtable. One lookup can have multiple subtables, and one subtable can have multiple coverage tables, so 5 lookups leading to 12 coverage tables is entirely possible.
Trying to get the
glyphArray
for Athena Ruby doesn't work.Test code:
Example output for the console.log:
This confuses me a little :-) In the above loop, the console.log happens 12 times. The font has 5 lookup type 4 tables (
<LookupType value="4"/>
in a dumped .ttx file). Spec says "The subtable has one format: LigatureSubstFormat1". Or am I wrongly assuming coverageFormat points to that?