23 Commits

Author SHA1 Message Date
Simon Cozens
089f24da6b
Ensure all fonttools CLI tools have help documentation (#1948)
Note UI change : `fonttools varLib.models` now takes prefixed options `-d` or `-l` instead of guessing the intended feature from the number of arguments.

We have a number of command line tools which are somewhat opaque. (varLib.models in particular was very confusing.) This ensures that they all use argparse to have a consistent interface, and all have --help documentation which at least details their parameters, and hopefully therefore gives more of a clue about what they do. Those which use logging have had a command-line logging parameter added.
2020-05-12 15:11:30 +01:00
Simon Cozens
2cef07af80
[doc] Add help options to fonttools CLI (#1920)
This adds a `help` verb (and `--help` option) to the `fonttools` command line tool. Submodules will be listed in the help text if they have an importable `main` function with a docstring, and `main`'s docstring will be used as the one-line description for the help text.
2020-05-12 06:31:13 +01:00
Simon Cozens
253de13377 Use inheritance to avoid repeated code in WOFF2FlavorData initializer 2020-05-07 21:04:52 +01:00
Cosimo Lupo
be147e965d
woff2: don't attempt to normalize glyf/loca if missing (e.g. CBDT/CBLC fonts like NotoColorEmoji.ttf) 2020-02-26 18:14:31 +00:00
Chris Simpkins
791f619029 refactor array.tostring to array.tobytes
the array.tostring method is deprecated
2019-08-29 23:21:22 -04:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Cosimo Lupo
84e9ea167a
woff2: allow to recompress woff2 while keeping flavorData
optionally modifying the list of transformed tables
2019-06-19 12:13:14 +01:00
Cosimo Lupo
1c369da8c9
woff2: fix typo 2019-06-19 11:47:32 +01:00
Cosimo Lupo
6ba7c3c9e2
woff2: initialize WOFF2FlavorData from existing WOFFFlavorData
Fixes #1650

A regression was introduced with 3.43.0 when doing pyftsubset --flavor=woff2
and the input font is WOFF 1.0, thus it has a non-None flavorData already
but doesn't define the transformTables attribute.
2019-06-19 11:44:40 +01:00
Cosimo Lupo
a96d2dba73
woff2: add main() to call 'compress' and 'decompress' subcommands
$ fonttools ttLib.woff2 --help
2019-06-14 18:18:21 +01:00
Cosimo Lupo
deaeb909a7
woff2: add support for hmtx transformation
no tests yet

fixup
2019-06-13 18:07:14 +01:00
Cosimo Lupo
0162446f4c
woff2: don't normalize glyf+loca if we aren't transforming them
Also, the TTFont.getGlyphOrder() automatically makes up a dummy
glyph order from the maxp.numGlyphs, we simply need to ensure
'maxp' is decompiled before 'glyf'.

When transforming glyf, the glyf.glyphOrder is guaranteed to
be present (as the glyf table has been already decompiled), so
we don't need to deal with it being missing or incorrect
(hence removed spurious tests).
2019-06-12 18:41:13 +01:00
Cosimo Lupo
c98b71af5c
woff2: add support for unstransformed glyf and loca tables
Fixes https://github.com/fonttools/fonttools/issues/1636
2019-06-11 15:12:27 +01:00
Behdad Esfahbod
349cd94d17 [graphite] Fix for big-endian
Make all "if sys.byteorder..." and "byteswap" be on the same line for
earsier grep verification.

Fixes https://github.com/fonttools/fonttools/issues/1311
2018-09-05 21:12:53 -07:00
Cosimo Lupo
6a92ae085b [woff2] replace print with logger 2016-01-27 19:01:12 +00:00
Sascha Brawer
5f5b07b8d7 Merge pull request #349 from brawer/glyphnames-beyond-bmp
Support non-BMP characters for synthetic glyph names
2015-09-09 15:03:06 +02:00
Cosimo Lupo
f8e59445c1 [woff2] minor 2015-09-09 12:16:49 +01:00
Cosimo Lupo
ed03d57170 [woff2] make dummy glyphOrder based on gids when decompiling glyf table
Using TTFont.getGlyphOrder() would also require to decompile post and cmap tables.
But we don't need the actual glyph names in order to apply the WOFF2 glyf transform.
2015-09-08 17:01:59 +01:00
Cosimo Lupo
ef71757a42 [woff2] cache reconstructed glyf data if requested to reconstruct loca before glyf 2015-08-19 22:58:17 +01:00
Cosimo Lupo
3142e3319e add reordersTables() method to SFNTWriter and WOFF2Writer (return True for the latter) 2015-08-19 17:56:46 +01:00
Cosimo Lupo
f083209590 [woff2] use OrderedDict like sfnt module 2015-08-19 16:36:03 +01:00
Cosimo Lupo
2a713bfd79 [woff2/woff2_test] replace 'StringIO' with 'BytesIO' 2015-08-07 18:23:55 +01:00
Cosimo Lupo
b6ce7ae668 [woff2] add woff2 module with support for reading/writing single WOFF2 fonts (no font collections yet) 2015-08-07 18:23:41 +01:00