Skip to content

Commit

Permalink
Merge pull request #984 from googlefonts/gen-stat-validate
Browse files Browse the repository at this point in the history
stat: validate AxisValues names are strings
  • Loading branch information
m4rc1e authored Jun 11, 2024
2 parents ceaeeb5 + 6d6b2c0 commit c14661a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Lib/gftools/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ def gen_stat_tables_from_config(stat, varfonts, has_italic=None, locations=None)
for ax in stat:
if ax["tag"] == "ital":
raise ValueError("ital axis should not appear in stat config")
for av in ax.get("values", []):
av_name = av.get("name")
if not isinstance(av_name, str):
raise ValueError(
f"Axis value name must be a string, got {type(av_name)}: {av_name}"
)
ital_stat_for_roman = {
"name": "Italic",
"tag": "ital",
Expand Down

0 comments on commit c14661a

Please sign in to comment.