Skip to content

Commit

Permalink
Merge pull request #575 from googlefonts/report-source-fixes-more-car…
Browse files Browse the repository at this point in the history
…efully

Don't crash on removed name table entries
  • Loading branch information
simoncozens authored Jun 24, 2022
2 parents 1d6643b + 1829f5f commit 76d5378
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/gftools/fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<removed>"): inst.coordinates for inst in fvar.instances }
default_axis_vals = {a.axisTag: a.defaultValue for a in fvar.axes}

stylename = font_stylename(ttFont)
Expand Down Expand Up @@ -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, "<removed>")
if new_name != old_name:
log.info("- %i: %s", nid, old_name)
log.info("+ %i: %s", nid, new_name)
Expand Down

0 comments on commit 76d5378

Please sign in to comment.