From b98cdb1f29784a0e7674ff800c17a308ae762ec6 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 22 Apr 2024 16:39:07 +0200 Subject: [PATCH] Sanitize location first, so we won't get a wrong HAVE_AXES flag etc. --- src/fontra_compile/builder.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/fontra_compile/builder.py b/src/fontra_compile/builder.py index b1b00e3..5fde693 100644 --- a/src/fontra_compile/builder.py +++ b/src/fontra_compile/builder.py @@ -284,6 +284,13 @@ async def collectComponentInfo(self, glyph: VariableGlyph) -> list[ComponentInfo numSources = len(glyphSources) for compoInfo in components: + # Filter out unknown/unused axes + compoInfo.location = { + axisName: values + for axisName, values in compoInfo.location.items() + if values + } + isVariableComponent = bool(compoInfo.location) flags = 0 @@ -304,13 +311,6 @@ async def collectComponentInfo(self, glyph: VariableGlyph) -> list[ComponentInfo if attrName in VARCO_IF_VARYING: isVariableComponent = True - # Filter out unknown/unused axes - compoInfo.location = { - axisName: values - for axisName, values in compoInfo.location.items() - if values - } - axesAtDefault = [] for axisName, values in compoInfo.location.items(): firstValue = values[0]