diff --git a/Lib/fontTools/ttLib/tables/_g_l_y_f.py b/Lib/fontTools/ttLib/tables/_g_l_y_f.py index 911714d96..8e3e1bdee 100644 --- a/Lib/fontTools/ttLib/tables/_g_l_y_f.py +++ b/Lib/fontTools/ttLib/tables/_g_l_y_f.py @@ -1355,22 +1355,6 @@ class GlyphCoordinates(object): for i in range(len(a)): a[i] = -a[i] return r - def __abs__(self): - """ - >>> g = GlyphCoordinates([(-1.5,2)]) - >>> g - GlyphCoordinates([(-1.5, 2.0)]) - >>> g2 = abs(g) - >>> g - GlyphCoordinates([(-1.5, 2.0)]) - >>> g2 - GlyphCoordinates([(1.5, 2.0)]) - """ - r = self.copy() - a = r._a - for i in range(len(a)): - a[i] = abs(a[i]) - return r def __round__(self): """ Note: This is Python 3 only. Python 2 does not call __round__. diff --git a/Lib/fontTools/varLib/__init__.py b/Lib/fontTools/varLib/__init__.py index 2eb5347ef..ed9885b91 100644 --- a/Lib/fontTools/varLib/__init__.py +++ b/Lib/fontTools/varLib/__init__.py @@ -232,6 +232,8 @@ def _optimize_delta(delta, coords, ends): def _add_gvar(font, model, master_ttfs, tolerance=.5, optimize=True): + assert tolerance >= 0 + log.info("Generating gvar") assert "gvar" not in font gvar = font["gvar"] = newTable('gvar') @@ -261,9 +263,7 @@ def _add_gvar(font, model, master_ttfs, tolerance=.5, optimize=True): endPts = control[1] if control[0] >= 1 else list(range(len(control[1]))) for i,(delta,support) in enumerate(zip(deltas[1:], supports[1:])): - if all(0 == v for v in delta.array): - continue - if tolerance and max(abs(delta).array) <= tolerance: # XXX + if all(abs(v) <= tolerance for v in delta.array): continue var = TupleVariation(support, delta) if optimize: