Skip to content

Commit

Permalink
Remove wrong optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
behdad committed May 29, 2024
1 parent 903ab1e commit b5daf17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
14 changes: 6 additions & 8 deletions component.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand All @@ -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):
Expand Down

0 comments on commit b5daf17

Please sign in to comment.