summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2021-04-01 04:29:34 +0300
committerRasmus Andersson <rasmus@notion.se>2021-04-01 04:29:34 +0300
commit6462e5b7a3666135b4f37a1d24615103ca76603c (patch)
treef5470756f67c8deec88422f35f571fbc08b42105
parent59db83bfbd425538e6831e1e9ee11c4e338824e1 (diff)
downloadinter-6462e5b7a3666135b4f37a1d24615103ca76603c.tar.xz
tooling: adjust include? filter for glyphs, after upgrading 3rd party libraries which changed behavior
-rwxr-xr-xmisc/fontbuild6
-rw-r--r--misc/glyphs-scripts/assign-fallback-codepoints.py4
2 files changed, 8 insertions, 2 deletions
diff --git a/misc/fontbuild b/misc/fontbuild
index c649fc5e1..d51bb48df 100755
--- a/misc/fontbuild
+++ b/misc/fontbuild
@@ -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)
diff --git a/misc/glyphs-scripts/assign-fallback-codepoints.py b/misc/glyphs-scripts/assign-fallback-codepoints.py
index 35b67a39a..e70b10c24 100644
--- a/misc/glyphs-scripts/assign-fallback-codepoints.py
+++ b/misc/glyphs-scripts/assign-fallback-codepoints.py
@@ -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