From b73969b2ffab954916a5f6c52db9efe0e5299372 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 2 Aug 2023 15:54:34 +0100 Subject: [PATCH] ignore lsb, just use 0xFFFF for sparse advance --- Lib/fontTools/varLib/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/fontTools/varLib/__init__.py b/Lib/fontTools/varLib/__init__.py index 22e244112..b130d5b2a 100644 --- a/Lib/fontTools/varLib/__init__.py +++ b/Lib/fontTools/varLib/__init__.py @@ -563,17 +563,17 @@ def _get_advance_metrics( ): vhAdvanceDeltasAndSupports = {} vOrigDeltasAndSupports = {} - # HACK: we treat width 65535 and lsb 0 as sentinel values to signal that a glyph + # HACK: we treat width 65535 as a sentinel value to signal that a glyph # from a non-default master should not participate in computing {H,V}VAR, # as if it were missing. Allows to variate other glyph-related data independently # from glyph metrics - sparse_metrics = (0xFFFF, 0) + sparse_advance = 0xFFFF for glyph in glyphOrder: vhAdvances = [ metrics[glyph][0] - if glyph in metrics and metrics[glyph] != sparse_metrics + if glyph in metrics and metrics[glyph][0] != sparse_advance else None - for i, metrics in enumerate(advMetricses) + for metrics in advMetricses ] vhAdvanceDeltasAndSupports[glyph] = masterModel.getDeltasAndSupports( vhAdvances, round=round