fontbuild: remove component condition in composedGlyphIsNonTrivial

This commit is contained in:
Rasmus Andersson 2019-07-18 14:04:29 -07:00
parent b2b8c14660
commit a96f0d50f2

View file

@ -61,8 +61,6 @@ def fatal(msg):
def composedGlyphIsNonTrivial(g):
# A non-trivial glyph is one that uses reflecting component transformations.
if g.components and len(g.components) > 0:
if len(g.components) > 1:
return True
for c in g.components:
# has non-trivial transformation? (i.e. scaled)
# Example of optimally trivial transformation:
@ -70,7 +68,8 @@ def composedGlyphIsNonTrivial(g):
# Example of scaled transformation matrix:
# (-1.0, 0, 0.3311, 1, 1464.0, 0) flipped x axis, sheered and offset
#
xScale, xyScale, yxScale, yScale, xOffset, yOffset = c.transformation
xScale = c.transformation[0]
yScale = c.transformation[3]
# If glyph is reflected along x or y axes, it won't slant well.
if xScale < 0 or yScale < 0:
return True