Skip to content

Commit

Permalink
Glyphs doesn't store weightClass=400 etc, make them up
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed May 8, 2024
1 parent a1c0961 commit 63d8796
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/babelfont/convertors/glyphs/glyphs3.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,21 @@ def interpret_axis_mappings(self):
# If there isn't an Axis Location, use the weightclass and widthclass
if not c:
weightclass = instance._formatspecific.get("com.glyphsapp", {}).get(
"weightClass"
"weightClass", 400
)
if weightclass is not None:
c.append({"Axis": "Weight", "Location": weightclass})
widthclass = instance._formatspecific.get("com.glyphsapp", {}).get(
"widthClass"
"widthClass", 5
)
if widthclass is not None:
c.append({"Axis": "Width", "Location": widthclass})
for loc in c:
ax = axes_by_name[loc["Axis"]]
ax = axes_by_name.get(loc["Axis"])
if not ax:
# Maybe we don't have a weight or width but we don't have
# an axis location either so we synthesised those locations
continue
if not ax.map:
ax.map = []
ax.map.append(
Expand Down

0 comments on commit 63d8796

Please sign in to comment.