This avoids pitfalls from type checkers having to work with limited
information, e.g., a type checker may implicitly assume that only
integers are expected where a default value is 1, whereas in reality any
float is accepted.
[Docs] Fill out ttLib table section. Part of a bottom-up docs rework for ttLib.
Note that 23546cf changes the `import`s for ttLib/tables/_g_v_a_r.py to un-confuse autodoc.
When passing a parsed feature file that has variable anchors to
addOpenTypeFeatures(), builder would modify the anchors in place and
discard the variations, which break any subsequent use of the feature
file.
I encountered this building a font that has variable cursing anchors
with ufo2ft. The cursFeatureWriter would write the variable anchors, but
then when kernFeatreWriter compiles the file to get GSUB closure, the
variation would be dropped from the anchors, and later when when the
feature data is compiled into the font, the anchors would be compiled
without variations.
In some cases we were seeing different output from iup depending on
whether or not we were running cython code.
I've tracked this particular issue down to the line that is changed in
this diff, and the change introduced in this diff does (locally, for me,
on one machine with one architecture and one compiler) seem to suppress
the problem.
However... it feels pretty bad??
I'm not sure how motivated I am to try and generate a proper minimal
test case and try to get this fixed upstream. I guess I'm.. medium
motivated? But at the very least it would be nice to figure out a more
robust way to prevent this optimization from happening, and at the very
_very_ least it would be nice to figure out away to test this.
The solution I was hoping for was some way to write some actual
hand-written C so we could have finer-grained control over what's going
on, and use that just for this one little bit of arithmetic, but I
didn't see an easy way to do that.
The consideration for blends had made it into O(n^2).
Make it linear again.
Speeds up Tests/cffLib/specializer_test.py::CFFSpecializeProgramTest::test_maxstack_blends
3x for me.
The code was always merging at least two blends, which was causing
stack-overflow with a test font of ours. Move the overflow check
earlier to catch that.
Fixes https://github.com/fonttools/fonttools/issues/3676