From ded07d03b692475c2bfff1a652c106b4fb18cbda Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Mon, 17 Aug 2020 17:12:31 -0700 Subject: [PATCH] adds "decompose" directive to fontbuild --- misc/fontbuildlib/builder.py | 5 +++-- misc/fontbuildlib/glyph.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/fontbuildlib/builder.py b/misc/fontbuildlib/builder.py index 98166d5ac..b4a53df1b 100644 --- a/misc/fontbuildlib/builder.py +++ b/misc/fontbuildlib/builder.py @@ -115,9 +115,10 @@ class FontBuilder: glyphsToRemoveOverlaps = set() # glyph objects for ufo in masters: 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) - if 'removeoverlap' in findGlyphDirectives(g.note): + if 'removeoverlap' in directives: if g.components and len(g.components) > 0: glyphNamesToDecompose.add(g.name) glyphsToRemoveOverlaps.add(g) diff --git a/misc/fontbuildlib/glyph.py b/misc/fontbuildlib/glyph.py index 734b881e0..8511aa190 100644 --- a/misc/fontbuildlib/glyph.py +++ b/misc/fontbuildlib/glyph.py @@ -16,6 +16,7 @@ from fontTools.pens.reverseContourPen import ReverseContourPen # knownDirectives = set([ 'removeoverlap', # applies overlap removal (boolean union) + 'decompose', # decomposes components ])