'fontTools' is not a folder name, but the import name of the package
where we have some doctests to be discovered and run.
even though we have --pyargs option (which makes pytest first attempt
to treat any positional arguments as module import names), with the
latest pytest 4.0.0 our tests started to fail as if the new pytest
is evaluating the default 'testpaths' (as defined in setup.cfg, used
when no arguments are supplied to pytest) _before_ the --pyargs
option, and thus it thinks that 'fontTools' is a directory name
instead of a package name...
This a workaround. It also means that if one runs `pytest` without
arguments, only the tests inside `Tests` directory are going to be
run automatically, and not also the doctests inside fontTools package.
When running the test suite using tox, all tests are run, both
those in Tests folder and the doctests in fontTools.
Fix syntax error reported by build system: can't mix string string types when doing literal concatenation
Fix local import reference - doesn't work in Python3.
Addressed issues raised by @msousa for PR 1345 yesterday.
Will change cff2_merge_funcs.py and cff2mergePen.py from tab to space indentations after the current comments are resolved.
Add various improvements from comments:
- do not edit the post table under varLib.build(). Setting post table format 2 or 3 is now expected to be managed by whatever calls varLib.build().
- In the t2CharStringPen module, rename closure _round() nested in makeRoundFunc to an exportable function, and use it in cff2mergePen.
- remove TypeSupply copyright from cff2mergePen.
- use modulo function to convert float to int when it is meant to be 0 in cff2mergePen.
cff2_merge_funcs.py:merge_PrivateDicts() should only be blending the hint related fields in the PrivateDict. This oversight that was surfaced by @madig reporting an error building his Cantrell font. The bug appeared when the font was subroutinized, as the pen draw method then has to interpret the Subr field in order to access T2Charstring subroutines.
Fix expected ttx output file. When I removed the logic to add glyph names to the post table, glyph names in the ttx file changed.
Miguel prefers a simple list for readability in cff2_merge_funs.py:138.
Add test for building CFF2 variable font with a call to varLib.build().
The 'dollar' glyph in the test font is deliberately slightly malformed, with flat curves, in order to exercise the code for dealing with some of the differences in masters designs that can arise from T2 charstring optimization.
See 0283b1f.
By finishing overlayBox() to cull remainder box when possible, we generate
far fewer spurious boxes, if any.
For the featureVars_test.py test case, this now generates optimal output,
that is, 2*n - 1 boxes.
Running time for n=20 stays at 0.06s, which is probably Python startup
time.
Running time for n=100 is down from 2.5s with unoptimized new algorithm,
to 0.17s for this and number of output boxes from 5050 to the optimal 199.
Fixes#1372 again