skip empty paths with no contours

https://github.com/fonttools/fonttools/pull/2068#pullrequestreview-498472660
This commit is contained in:
Cosimo Lupo 2020-09-29 14:48:24 +01:00
parent e1ad83add7
commit 7b9da7602c
No known key found for this signature in database
GPG Key ID: 179A8F0895A02F4F

View File

@ -111,7 +111,11 @@ def removeOverlaps(
for glyphName in glyphNames:
glyph = glyfTable[glyphName]
# decompose composite glyphs only if components overlap each other
if glyph.isComposite() and not componentsOverlap(glyph, glyphSet):
if (
glyph.numberOfContours == 0
or glyph.isComposite()
and not componentsOverlap(glyph, glyphSet)
):
continue
path = skPathFromGlyph(glyphName, glyphSet)