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.
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.
When varLib was updated for avar table, this was not. Share code such
that they don't get out of sync again. All of this to be made into
proper API some time...
When reduce() receives an empty sequence, it raises TypeError, unless it is given a third 'initializer' argument
ValueFormat values should default to 0, so we shall use that as initializer.
Also, the reduce() built-in is no longer available on Python 3.
It's still accessible for both py2 and py3 from functools.
Fixes https://github.com/googlei18n/fontmake/issues/241
Also fixes issues with merging of PairPos.
Trying on Noto Sans Thai still fails, now because of issues in class differences in
PairPosFormat2. :( Investigating.
This is part of fixing https://github.com/fonttools/fonttools/issues/719
though, the changes are currently in interpolate_layout, and need to be ported /
merged with varLib.__init__ variation-font-builder.
The convention is that sys.exit(...) is called only if a module is run as a script,
and that main() entry points use return statements to report exit codes: 0 (or None)
for successful execution, or any non-zero integer for errors.
E.g. see the console scripts generated when installing with pip.