Skip to content

Commit 45f1092

Browse files
jenskutilekfelipesanches
authored andcommitted
Don't crash if a variable font has no STAT table
1 parent 9532556 commit 45f1092

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/fontbakery/checks/opentype/varfont/STAT_axis_record_for_each_axis.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fontbakery.prelude import check, Message, FAIL, PASS
1+
from fontbakery.prelude import FAIL, PASS, SKIP, Message, check
22
from fontbakery.utils import bullet_list
33

44

@@ -16,6 +16,10 @@
1616
def check_varfont_STAT_axis_record_for_each_axis(ttFont, config):
1717
"""All fvar axes have a correspondent Axis Record on STAT table?"""
1818
fvar_axes = set(a.axisTag for a in ttFont["fvar"].axes)
19+
if "STAT" not in ttFont:
20+
yield SKIP, Message("missing-axis-records", "The font has no STAT table.")
21+
return
22+
1923
STAT_axes = set(a.AxisTag for a in ttFont["STAT"].table.DesignAxisRecord.Axis)
2024
missing_axes = fvar_axes - STAT_axes
2125
if len(missing_axes) > 0:

0 commit comments

Comments
 (0)