[glyf] skip empty components when computing bounds of composite glyphs

This commit is contained in:
Cosimo Lupo 2023-11-14 16:47:20 +00:00
parent aaed718e41
commit 4610bf39e3
No known key found for this signature in database
GPG Key ID: DF65A8A5A119C9A8

View File

@ -1211,6 +1211,9 @@ class Glyph(object):
g.recalcBounds(glyfTable, boundsDone=boundsDone)
if boundsDone is not None:
boundsDone.add(glyphName)
# empty components shouldn't update the bounds of the parent glyph
if g.numberOfContours == 0:
continue
x, y = compo.x, compo.y
bounds = updateBounds(bounds, (g.xMin + x, g.yMin + y))