* 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.
Fix for #1985:
* ensure that the AxisNameID in the STAT table is not less than 256. This needed an additional argument to the addMultiLingualName() name table method.
* fvar axis name IDs must also not be less than 256, just like STAT axis names.
_getUnicodeRangeSets used to calculate sets containing lots of numbers, only to
get intersections between a set and ranges. Creating and manipulating a lot of
big sets requires a lot of memory.
The function has been replaced by _getUnicodeRanges, returning a list of range
starts boundaries and a list of range stops + corresponding bits.
Tests on intersectUnicodeRanges save about 130 MB (!) of RAM, with no
significant speed penalty.
Adds __str__() method to ast classes that writes back VOLT data. Tries
to replicate VOLT syntax idiosyncrasies as much as possible for better
round-trip conversion.
This makes the directory to search for included files explicit.
Also use Python 3's FileNotFoundError to catch non-existant files instead of a workaround for Python 2.