From c06e8ba1e8772c50e8e62b3eb3bfcaff4acc17c0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 14 May 2024 18:26:35 -0600 Subject: [PATCH] [instancer/CFF2] Comment --- Lib/fontTools/varLib/instancer/__init__.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Lib/fontTools/varLib/instancer/__init__.py b/Lib/fontTools/varLib/instancer/__init__.py index fbc34d4c9..0952121c1 100644 --- a/Lib/fontTools/varLib/instancer/__init__.py +++ b/Lib/fontTools/varLib/instancer/__init__.py @@ -576,11 +576,15 @@ def changeTupleVariationAxisLimit(var, axisTag, axisLimit): def instantiateCFF2( varfont, axisLimits, *, round=round, specialize=True, generalize=False ): - # The algorithm here is rather simple: Take all blend operations and - # store their deltas in the (otherwise empty) CFF2 VarStore. Then, - # instantiate the VarStore with the given axis limits, and read back - # the new deltas. This is done for both the CharStrings and the Private - # dicts. + # The algorithm here is rather simple: + # + # Take all blend operations and store their deltas in the (otherwise empty) + # CFF2 VarStore. Then, instantiate the VarStore with the given axis limits, + # and read back the new deltas. This is done for both the CharStrings and + # the Private dicts. + # + # Then prune unused things and possibly drop the VarStore if it's empty. + # In which case, TODO: downgrade to CFF table. log.info("Instantiating CFF2 table") @@ -590,6 +594,7 @@ def instantiateCFF2( topDict = cff.topDictIndex[0] varStore = topDict.VarStore.otVarStore if not varStore: + # TODO Downgrade to CFF if requested. return cff.desubroutinize() @@ -804,6 +809,8 @@ def instantiateCFF2( for private in privateDicts: del private.vstore + # TODO Downgrade to CFF if requested. + def _instantiateGvarGlyph( glyphname, glyf, gvar, hMetrics, vMetrics, axisLimits, optimize=True