googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
151 stars 43 forks source link

add convertCubics to compileVariable; check no cubics if glyphDataFormat=0 #769

Closed anthrotype closed 1 year ago

anthrotype commented 1 year ago

compileTTF (for static TTF builds) already have a convertCubics=True that when set to False completely skips the cu2qu. So I added one for the compileInterpolatableTTF/compileVariableTTF methods as well, so that from fontmake one can request to pass through the cubics unchanged.

Also I made so the OutlineTTFCompiler checks that if glyphDataFormat=0, then no cubic flags are set and raise an error in they do, prompting to either convert to quadratic or to explicitly allow allQuadratic=False (which in turn sets glyphDataFormat=1). This is to prevent from accidentally building glyf v1 table.