tooling: adjust include? filter for glyphs, after upgrading 3rd party libraries which changed behavior

This commit is contained in:
Rasmus Andersson 2021-03-31 18:29:34 -07:00
parent 59db83bfbd
commit 6462e5b7a3
2 changed files with 8 additions and 2 deletions

View file

@ -286,16 +286,22 @@ class Main(object):
# process glyphs
glyphOrder = OrderedDict([(k,None) for k in font.lib['public.glyphOrder']])
rmglyphs = []
for g in font:
if not g.lib.get('com.schriftgestaltung.Glyphs.Export', True):
if g.name in glyphOrder:
del(glyphOrder[g.name])
rmglyphs.append(g.name)
g.unicodes = []
continue
if EXCLUDE_ANCHORS:
g.clearAnchors()
if 'com.schriftgestaltung.Glyphs.lastChange' in g.lib:
del(g.lib['com.schriftgestaltung.Glyphs.lastChange'])
for gname in rmglyphs:
del(font[gname])
# update possibly modified glyphorder
font.lib['public.glyphOrder'] = list(glyphOrder)

View file

@ -30,9 +30,9 @@ def isEmpty(g):
def includeGlyph(g):
if not g.export:
return False
if g.name[0] == '.':
if g.name[0] == '.' or g.name[0] == '_':
return False
if g.name.endswith(".case"):
if g.name.endswith(".case") or g.name.endswith(".cn"):
return False
# finally, return true if the glyph has no codepoint assigned
return g.unicodes is None or len(g.unicodes) == 0