ignore lsb, just use 0xFFFF for sparse advance

This commit is contained in:
Cosimo Lupo 2023-08-02 15:54:34 +01:00
parent 48ae9cbf1c
commit b73969b2ff
No known key found for this signature in database
GPG Key ID: DF65A8A5A119C9A8

View File

@ -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