adds "decompose" directive to fontbuild

This commit is contained in:
Rasmus Andersson 2020-08-17 17:12:31 -07:00
parent 87c4a09ce3
commit ded07d03b6
2 changed files with 4 additions and 2 deletions

View file

@ -115,9 +115,10 @@ class FontBuilder:
glyphsToRemoveOverlaps = set() # glyph objects glyphsToRemoveOverlaps = set() # glyph objects
for ufo in masters: for ufo in masters:
for g in ufo: for g in ufo:
if g.components and not composedGlyphIsTrivial(g): directives = findGlyphDirectives(g.note)
if 'decompose' in directives or (g.components and not composedGlyphIsTrivial(g)):
glyphNamesToDecompose.add(g.name) glyphNamesToDecompose.add(g.name)
if 'removeoverlap' in findGlyphDirectives(g.note): if 'removeoverlap' in directives:
if g.components and len(g.components) > 0: if g.components and len(g.components) > 0:
glyphNamesToDecompose.add(g.name) glyphNamesToDecompose.add(g.name)
glyphsToRemoveOverlaps.add(g) glyphsToRemoveOverlaps.add(g)

View file

@ -16,6 +16,7 @@ from fontTools.pens.reverseContourPen import ReverseContourPen
# #
knownDirectives = set([ knownDirectives = set([
'removeoverlap', # applies overlap removal (boolean union) 'removeoverlap', # applies overlap removal (boolean union)
'decompose', # decomposes components
]) ])