From 1829f5f59c642c9aa1b93b619c72e50ffb4d7072 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Tue, 21 Jun 2022 21:43:02 +0100 Subject: [PATCH] Don't crash on removed name table entries --- Lib/gftools/fix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/gftools/fix.py b/Lib/gftools/fix.py index d653d4529..e6e689bb4 100644 --- a/Lib/gftools/fix.py +++ b/Lib/gftools/fix.py @@ -276,7 +276,7 @@ def fix_fvar_instances(ttFont): raise ValueError("ttFont is not a variable font") fvar = ttFont["fvar"] - old_instances = { ttFont["name"].getDebugName(inst.subfamilyNameID): inst.coordinates for inst in fvar.instances } + old_instances = { (ttFont["name"].getDebugName(inst.subfamilyNameID) or ""): inst.coordinates for inst in fvar.instances } default_axis_vals = {a.axisTag: a.defaultValue for a in fvar.axes} stylename = font_stylename(ttFont) @@ -452,7 +452,7 @@ def fix_nametable(ttFont): if old_nametable != new_nametable: log.info("Name table entries changed (consider fixing the source instead):") for nid, old_name in old_nametable.items(): - new_name = new_nametable[nid] + new_name = new_nametable.get(nid, "") if new_name != old_name: log.info("- %i: %s", nid, old_name) log.info("+ %i: %s", nid, new_name)