This reverts commit 690080b14d9a4f193092ffc172a39b3e212d307c.
We keep 16-bit GlyphIDs for COLRv1 tables, at least for now
https://github.com/googlefonts/colr-gradients-spec/pull/24
I keep the GlyphID32 converter in case we may need it in the future.
It's a bit gross, but I'm blaming OpenType for that. I'm doing this now because otherwise it would be even more repetitive once we start adding format 1 Rule and Ruleset subtables.
Currently unused but will be super helpful for optimizing the formats of contextual lookups.
* Splits the rules of a class contextual lookup based on explicit subtable breaks
* Returns various properties on the ruleset to help determine appropriate layout format.
* (More properties, such as "touched glyphs", planned - will be added when needed.)
Document otlLib
Includes other minor changes:
* When a markFilterSet parameter is passed to a builder, LOOKUP_FLAG_USE_MARK_FILTERING_SET will be added to the lookup's flags.
* The unused arguments valueformat1 and valueformat2 were removed from ClassPairPosSubtableBuilder.
* Introduce a new subclass for chained contextual (sub and pos)
* Rename .substitutions to .rules in subst builders to allow for code reuse
* Make format of subtable break marker tuple common between sub/pos
Note that prior to this patch, add_subtable_break in a Subst builder adds:
(self.SUBTABLE_BREAK_, self.SUBTABLE_BREAK_, self.SUBTABLE_BREAK_, self.SUBTABLE_BREAK_)
while add_subtable_break in a Pos builder adds:
(self.SUBTABLE_BREAK_, self.SUBTABLE_BREAK_, self.SUBTABLE_BREAK_, [self.SUBTABLE_BREAK_])
This is messy. If we read the first element from the tuple instead of the last one to test if a rule is a subtable break, we can make the marker tuple the same.
* And now the subtable break code can be hoisted into superclass
* These helper methods will make the build routine common
* Hoist common build method to superclass
The diff doesn’t show it very clearly because it’s being too clever, but all I’ve done is moved one method. Everything works apart from the error message, which comes next.
* Fix the error message
Refactors feaLib, moving code which builds OpenType lookups into otlLib. Note that this changes feaLib's concept of `location` from a tuple to an object.