From b5daf17b7dc558ab26f6949a3050676f445a9e1c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 29 May 2024 10:43:27 -0600 Subject: [PATCH] Remove wrong optimization --- __init__.py | 2 +- component.py | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/__init__.py b/__init__.py index 06e819b..455b65f 100644 --- a/__init__.py +++ b/__init__.py @@ -39,7 +39,7 @@ async def main(args): glyphs[glyphname] = glyph await buildVarcFont(rcjkfont, glyphs) - await buildFlatFont(rcjkfont, glyphs) + #await buildFlatFont(rcjkfont, glyphs) if __name__ == "__main__": diff --git a/component.py b/component.py index 7136407..7135d94 100644 --- a/component.py +++ b/component.py @@ -117,15 +117,13 @@ def analyzeComponents(glyph_masters, glyphs, glyphAxes, publicAxes): loc = normalizeLocation(loc, allComponentAxes[i]) for name in ca.coordinates: c = loc.get(name, 0) - if c: - ca.coordinateHaveReset.add(name) - if c != masterLocation.get(name, 0) or ( - name in publicAxes and name not in glyphAxes - ): - ca.coordinateHaveOverlay.add(name) + # Currently we don't have any optimizations using the reset flag. + # Just add it to both sets. + ca.coordinateHaveReset.add(name) + ca.coordinateHaveOverlay.add(name) for ca in cas: - ca.coordinatesReset = len(ca.coordinateHaveReset) <= len( + ca.coordinatesReset = len(ca.coordinateHaveReset) < len( ca.coordinateHaveOverlay ) ca.coordinateHave = ( @@ -138,7 +136,7 @@ def analyzeComponents(glyph_masters, glyphs, glyphAxes, publicAxes): loc = component.location loc = normalizeLocation(loc, allComponentAxes[i]) for name in ca.coordinates: - # XXX Is this logic correct for coordinatesReset? + # XXX Is this logic correct for coordinatesHaveReset? if name in ca.coordinateHave and loc.get(name, 0) != defaultLocations[ i ].get(name, 0):