Skip to content

Commit

Permalink
Ensure location is dense; Ensure the new axis range does not *exceed*…
Browse files Browse the repository at this point in the history
… the old range
  • Loading branch information
justvanrossum committed Dec 13, 2024
1 parent 54fa567 commit 6d01629
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fontra/core/instancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ def instantiate(

if self.fontInstancer.variableGlyphAxisRanges is not None:
self.fontInstancer.updateVariableGlyphAxisRanges(
self.glyph.name, subsetLocationKeep(location, self.glyphAxisNames)
self.glyph.name,
subsetLocationKeep(
self.defaultSourceLocation | location, self.glyphAxisNames
),
)

try:
Expand Down
2 changes: 2 additions & 0 deletions src/fontra/workflow/actions/glyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ def trimGlyphByAxisRanges(fontInstancer, instancer, axisRanges):
newAxes = []
for axis in glyph.axes:
axisRange = axisRanges.get(axis.name)
# Ensure the range is actually within the original axis' range
axisRange.clipRange(axis.minValue, axis.maxValue)
if axisRange is None:
axisRanges[axis.name] = AxisRange(axis.defaultValue, axis.defaultValue)
elif axisRange.isEmpty():
Expand Down

0 comments on commit 6d01629

Please sign in to comment.