From 41fa9090a0bf288b28544f197478a33f570bc937 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 23 Jul 2023 19:08:13 -0600 Subject: [PATCH] [varLib.avarPlanner] Remove unused upem facilities Was only correct for weight axis. --- Lib/fontTools/varLib/avarPlanner.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Lib/fontTools/varLib/avarPlanner.py b/Lib/fontTools/varLib/avarPlanner.py index e68e8a7d2..8ad8ef446 100644 --- a/Lib/fontTools/varLib/avarPlanner.py +++ b/Lib/fontTools/varLib/avarPlanner.py @@ -338,14 +338,13 @@ def planAxis( out = {} outNormalized = {} - upem = 1 # font["head"].unitsPerEm axisMeasurements = {} for value in sorted({minValue, defaultValue, maxValue} | set(pins.values())): glyphset = glyphSetFunc(location={axisTag: value}) designValue = piecewiseLinearMap(value, pins) - axisMeasurements[designValue] = measureFunc(glyphset, glyphs) / (upem * upem) + axisMeasurements[designValue] = measureFunc(glyphset, glyphs) if sanitizeFunc is not None: log.info("Sanitizing axis limit values for the `%s` axis.", axisTag) @@ -374,9 +373,7 @@ def planAxis( log.info("Sampling value %g.", value) glyphset = glyphSetFunc(location={axisTag: value}) designValue = piecewiseLinearMap(value, pins) - valueMeasurements[designValue] = measureFunc(glyphset, glyphs) / ( - upem * upem - ) + valueMeasurements[designValue] = measureFunc(glyphset, glyphs) log.debug("Sampled average value:\n%s", pformat(valueMeasurements)) measurementValue = {}