Skip to content

Commit

Permalink
[varLib.main] Accept --quantization
Browse files Browse the repository at this point in the history
  • Loading branch information
behdad committed May 25, 2023
1 parent d9649a7 commit ae7394e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/fontTools/varLib/varStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,15 @@ def main(args=None):
from fontTools.ttLib.tables.otBase import OTTableWriter

parser = ArgumentParser(prog="varLib.varStore", description=main.__doc__)
parser.add_argument("--quantization", type=int, default=1)

Check warning on line 695 in Lib/fontTools/varLib/varStore.py

View check run for this annotation

Codecov / codecov/patch

Lib/fontTools/varLib/varStore.py#L695

Added line #L695 was not covered by tests
parser.add_argument("fontfile")
parser.add_argument("outfile", nargs="?")
options = parser.parse_args(args)

# TODO: allow user to configure logging via command-line options
configLogger(level="INFO")

quantization = options.quantization

Check warning on line 703 in Lib/fontTools/varLib/varStore.py

View check run for this annotation

Codecov / codecov/patch

Lib/fontTools/varLib/varStore.py#L703

Added line #L703 was not covered by tests
fontfile = options.fontfile
outfile = options.outfile

Expand All @@ -711,7 +713,7 @@ def main(args=None):
size = len(writer.getAllData())
print("Before: %7d bytes" % size)

varidx_map = store.optimize()
varidx_map = store.optimize(quantization=quantization)

Check warning on line 716 in Lib/fontTools/varLib/varStore.py

View check run for this annotation

Codecov / codecov/patch

Lib/fontTools/varLib/varStore.py#L716

Added line #L716 was not covered by tests

writer = OTTableWriter()
store.compile(writer, font)
Expand Down

0 comments on commit ae7394e

Please sign in to comment.