Skip to content

Commit

Permalink
[varStore] Another bugfix in optimize()
Browse files Browse the repository at this point in the history
  • Loading branch information
behdad committed May 24, 2023
1 parent e4281b0 commit 0677c0e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/fontTools/varLib/varStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ def _find_yourself_best_new_encoding(self, done_by_width):
else:
new_encoding = None
self.best_new_encoding = new_encoding
if new_encoding:
break


class _EncodingDict(dict):
Expand Down
13 changes: 13 additions & 0 deletions Tests/varLib/varStore_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ def buildAxis(axisTag):
2,
186,
),
(
5,
[
[10, 11, 0, 0, 20],
[10, 300, 0, 0, 20],
[10, 301, 0, 0, 20],
[10, 302, 0, 0, 20],
[10, 303, 0, 0, 20],
[10, 304, 0, 0, 20],
],
1,
180,
),
],
)
def test_optimize(numRegions, varData, expectedNumVarData, expectedBytes):
Expand Down

0 comments on commit 0677c0e

Please sign in to comment.