Skip to content

Commit

Permalink
Make sure locations are dense when mapping to new space
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Apr 19, 2024
1 parent f1a88ad commit 4d8dae5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fontra_rcjk/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ def upconvertShadowAxes(glyph, fontAxes):
if fontAxisNames.isdisjoint(glyphAxisNames):
return

defaultLocation = {axis.name: axis.defaultValue for axis in fontAxes + glyph.axes}

glyphAxesByName = {axis.name: axis for axis in glyph.axes}

for fontAxis in fontAxes:
Expand All @@ -260,7 +262,8 @@ def upconvertShadowAxes(glyph, fontAxes):
)

for source in glyph.sources:
v = source.location.get(axisName)
sourceLocation = defaultLocation | source.location
v = sourceLocation.get(axisName)
if v is not None:
source.location[axisName] = piecewiseLinearMap(v, mapping)

Expand Down

0 comments on commit 4d8dae5

Please sign in to comment.