From 2a06e9f735390a7988d0ef190981ce4abf4dfd28 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Sat, 27 Aug 2022 11:56:44 +0200 Subject: [PATCH] work around fontmake/ufo2ft weirdness where the .notdef gets the wrong width at sparse master locations that don't include .notdef; so include .notdef there --- scripts/shear_and_extrude.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/shear_and_extrude.py b/scripts/shear_and_extrude.py index 2f98b01..85238d2 100644 --- a/scripts/shear_and_extrude.py +++ b/scripts/shear_and_extrude.py @@ -517,6 +517,7 @@ def shearAndExtrude(path): axesByTag = {axis.tag: axis for axis in doc.axes} depthAxisFields = getAxisFields(axesByTag["EDPT"]) highlightAxisFields = getAxisFields(axesByTag["EHLT"]) + defaultFont = None for depth, depthName in depthAxisFields: extrudedFont = deepcopy(font) @@ -530,6 +531,7 @@ def shearAndExtrude(path): extrudedFont.lib[COLOR_PALETTES_KEY] = palettes extrudedFont.lib[COLOR_LAYERS_KEY] = colorGlyphs extrudedFont.features.text += manualFeatures + defaultFont = extrudedFont extrudedPath = path.parent / (path.stem + "-" + depthName + path.suffix) extrudedFont.save(extrudedPath, overwrite=True) @@ -551,6 +553,10 @@ def shearAndExtrude(path): if glyphName in layer: del layer[glyphName] + for gn in defaultFont.keys(): + if gn.startswith(".notdef"): + highlightFont[gn] = defaultFont[gn] + highlightPath = path.parent / (path.stem + "-" + highlightName + path.suffix) highlightFont.save(highlightPath, overwrite=True) doc.addSourceDescriptor(