Skip to content

Commit

Permalink
work around fontmake/ufo2ft weirdness where the .notdef gets the wron…
Browse files Browse the repository at this point in the history
…g width at sparse master locations that don't include .notdef; so include .notdef there
  • Loading branch information
justvanrossum committed Aug 27, 2022
1 parent 3116d11 commit 2a06e9f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/shear_and_extrude.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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(
Expand Down

0 comments on commit 2a06e9f

Please sign in to comment.