Skip to content

Commit

Permalink
Don't fail if there are no axis values
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens authored and felipesanches committed Nov 9, 2023
1 parent 7b527d9 commit 0672deb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Lib/axisregistry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,12 @@ def build_static_name_table(ttFont, family_name, style_name):

# If STAT table was using any removed names, add then back with a new ID
if "STAT" in ttFont and removed_names:
for av in ttFont["STAT"].table.AxisValueArray.AxisValue:
if av.ValueNameID in removed_names:
av.ValueNameID = name_table.addMultilingualName(
{"en": removed_names[av.ValueNameID]}
)
if ttFont["STAT"].table.AxisValueArray:
for av in ttFont["STAT"].table.AxisValueArray.AxisValue:
if av.ValueNameID in removed_names:
av.ValueNameID = name_table.addMultilingualName(
{"en": removed_names[av.ValueNameID]}
)
for av in ttFont["STAT"].table.DesignAxisRecord.Axis:
if av.AxisNameID in removed_names:
av.AxisNameID = name_table.addMultilingualName(
Expand Down

0 comments on commit 0672deb

Please sign in to comment.