Remove unneeded check, adjust tests

This commit is contained in:
Jens Kutilek 2019-12-19 11:52:29 +01:00 committed by Cosimo Lupo
parent 7f8f711dda
commit 2e13c733c8
3 changed files with 2 additions and 17 deletions

View File

@ -325,7 +325,6 @@ def _add_gvar(font, masterModel, master_ttfs, tolerance=0.5, optimize=True):
for glyph in font.getGlyphOrder():
log.debug("building gvar for glyph '%s'", glyph)
isComposite = glyf[glyph].isComposite()
allData = [
m.glyf._getCoordinatesAndControls(glyph, m.hMetrics, m.vMetrics)
@ -363,7 +362,7 @@ def _add_gvar(font, masterModel, master_ttfs, tolerance=0.5, optimize=True):
endPts = control.endPts
for i, (delta, support) in enumerate(zip(deltas[1:], supports[1:])):
if all(v == 0 for v in delta.array) and not isComposite:
if all(v == 0 for v in delta.array):
continue
var = TupleVariation(support, delta)
if optimize:

View File

@ -176,17 +176,6 @@
<delta pt="35" x="0" y="0"/>
</tuple>
</glyphVariations>
<glyphVariations glyph="odieresis">
<tuple>
<coord axis="slnt" value="-1.0"/>
<delta pt="0" x="0" y="0"/>
<delta pt="1" x="0" y="0"/>
<delta pt="2" x="0" y="0"/>
<delta pt="3" x="0" y="0"/>
<delta pt="4" x="0" y="0"/>
<delta pt="5" x="0" y="0"/>
</tuple>
</glyphVariations>
<glyphVariations glyph="uni0308">
<tuple>
<coord axis="slnt" value="-1.0"/>

View File

@ -339,10 +339,7 @@ class BuildTest(unittest.TestCase):
def test_varlib_gvar_explicit_delta(self):
"""The variable font contains a composite glyph odieresis which does not
need a gvar entry, because all its deltas are 0, but it must be added
anyway to work around an issue with macOS 10.14.
https://github.com/fonttools/fonttools/issues/1381
need a gvar entry.
"""
test_name = "BuildGvarCompositeExplicitDelta"
self._run_varlib_build_test(