From 4d8dae574810a2436bcc7b61fc0b362ba6bb85c0 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Fri, 19 Apr 2024 09:17:12 +0200 Subject: [PATCH] Make sure locations are dense when mapping to new space --- src/fontra_rcjk/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fontra_rcjk/base.py b/src/fontra_rcjk/base.py index 0f62dff..0b88c18 100644 --- a/src/fontra_rcjk/base.py +++ b/src/fontra_rcjk/base.py @@ -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: @@ -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)