8714 Commits

Author SHA1 Message Date
Cosimo Lupo
94b7cac969 setup.py: drop support for distutils-only setup; require setuptools
It's 2016.
2016-08-19 10:14:01 +01:00
Cosimo Lupo
3d8044ab92 travis: install latest python versions 3.4.5, 3.5.2 and pypy-5.3.1
remove unused py33 case
2016-08-19 10:04:39 +01:00
Cosimo Lupo
855c3b17c9 [woff2_test] adjust 'test_incorrect_compressed_size' to make it work with brotlipy
In the upstream google/brotli, if the `decompress` function receives an empty byte
string, it returns a brotli.error; whereas in 'brotlipy' it does not raise but
returns an empty string b"":
https://github.com/python-hyper/brotlipy/issues/43#issuecomment-240378257

This test case asserts that when 'totalCompressedSize' in the WOFF2 header is
incorrectly set, the woff2 reader fails -- either because the brotli decoder
raises an exception, or it returns a string whose length is not the one expected.
2016-08-17 12:07:02 +01:00
Cosimo Lupo
3ddc1f2fee .appveyor.yml: update job labels to match Appveyor installed python versions 2016-08-15 13:10:23 +01:00
Cosimo Lupo
793827e7c6 Appveyor: don't configure environment for C++ compiler as we now use pre-compiled Brotli wheels 2016-08-15 13:10:13 +01:00
Behdad Esfahbod
8701fedcfe More solveCubic() hardening
It really should be quite solid this time. :-)
2016-08-13 16:29:49 -07:00
Behdad Esfahbod
5bea5f4fd6 Remove unused line 2016-08-13 16:25:09 -07:00
Behdad Esfahbod
ca7f8d8808 Harden solveCubic() some more
Fixes https://github.com/behdad/fonttools/issues/617#issuecomment-239146815
2016-08-12 22:43:20 -07:00
Cosimo Lupo
f2e962c78f [ufo] don't check glyph names in glyphs_to_quadratic 2016-08-12 16:00:20 +01:00
Cosimo Lupo
e7854e5039 [ufo] add glyph[s]_to_quadratic to convert (1+ compatible) glyphs
This was requested in https://github.com/googlei18n/cu2qu/issues/26

Plus:
- do not modify input glyphs unless they contain one cubic curve;
- make public functions return True/False to signal that the input
  was modified or not (eg. no curves, or all quadratic)
2016-08-12 15:30:51 +01:00
Cosimo Lupo
1b2af584ff requirements.txt: use the latest Brotli 0.5.2 2016-08-12 11:14:42 +01:00
Behdad Esfahbod
9b3660df9f pointInsidePen: Disallow endPath()
https://github.com/behdad/fonttools/issues/621#issuecomment-234764830
2016-08-10 17:31:29 -07:00
Behdad Esfahbod
f3ff2f8881 pointInsidePen: add getWinding()
Resolves https://github.com/behdad/fonttools/issues/621#issuecomment-234764830

Although, leaving contours left open is out of protocol behavior
IMO.
2016-08-10 17:30:33 -07:00
Behdad Esfahbod
5cd0a55635 Ignore up to 4 bytes excess in kern subtables
Fixes https://github.com/behdad/fonttools/issues/314

Previously the warning message was wrong (probably a regression)
as it was reporting the the length of all kern data as "excess".
Fixing that, I see 4 bytes excess in Calibri.  Up to 4 is alright,
since many compilers add padding and wrongly add 4 instead of 0
sometimes.
2016-08-08 13:02:34 -07:00
Cosimo Lupo
fae8e1b498 Merge pull request #631 from anthrotype/woff-metadata-snippets
Snippets: add 'merge_woff_metadata.py' and 'dump_woff_metatada.py' scripts
2016-08-07 19:28:21 +01:00
Cosimo Lupo
4d7cd66ebc tox.ini: drop py33 testenv 2016-08-06 19:46:22 +01:00
Cosimo Lupo
9e60c3faff Merge pull request #649 from behdad/no-py33
.travis.yml: drop Python 3.3 support
2016-08-06 19:43:50 +01:00
Cosimo Lupo
b6ab441a1a .travis.yml: drop Python 3.3 support 2016-08-06 19:29:35 +01:00
Cosimo Lupo
189fac4758 setup.py: pep8 whitespace; remove unused imports 2016-08-06 13:37:39 +01:00
Cosimo Lupo
8e3b30a078 Revert "setup.py: version 3.1"
This reverts commit cef46f09cf2ddac7e4cd34ed385a094877a8bc4e.

Let's change the package version string only when we are ready to tag the new release.
2016-08-06 13:30:15 +01:00
Cosimo Lupo
c4df73beb6 Merge pull request #647 from anthrotype/pypi
[Travis] auto deploy to PyPI on tags
2016-08-06 13:27:21 +01:00
Cosimo Lupo
900a250896 .travis.yml: enable automatic PyPI deployment from Travis upon tags 2016-08-06 13:10:52 +01:00
Cosimo Lupo
cef46f09cf setup.py: version 3.1 2016-08-06 11:59:00 +01:00
Cosimo Lupo
6b2ac939dd add setup.cfg specifying 'universal' py2-py3 wheel format 2016-08-06 11:40:53 +01:00
Cosimo Lupo
4dc937ff11 Merge pull request #646 from anthrotype/brotli-0.4
requirements.txt: download Brotli 0.4.0 pre-compiled wheel from Github Releases
2016-08-06 11:38:24 +01:00
Cosimo Lupo
64d055c742 requirements.txt: download Brotli 0.4.0 pre-compiled wheel (or sdist) from Github Releases
this should speed up the Travis and Appveyor builds, as we don't need to compile
Brotli from source, at least on OSX and Windows. Linux will still use the
.tag.gz source distribution.
2016-08-06 11:30:41 +01:00
Behdad Esfahbod
ab3c0f82e6 Merge pull request #44 from googlei18n/more-optimizations
More optimizations
2016-08-01 18:11:49 -07:00
Behdad Esfahbod
c53ea86826 Use a generator for cubics[]
Not huge fan of it, but shows slight speedup, and is "Pythonic".
2016-08-01 18:10:16 -07:00
Behdad Esfahbod
9db52c9483 Avoid some more work
Saves another 7%.  Somehow I failed to push this to the last batch.
2016-08-01 14:34:41 -07:00
James Godfrey-Kittle
f5d067db86 Merge pull request #42 from googlei18n/fix-tests
Fix tests
2016-08-01 14:17:31 -07:00
James Godfrey-Kittle
fc5f5d194d Fix tests 2016-08-01 14:15:26 -07:00
Behdad Esfahbod
33478a9e49 Merge pull request #40 from googlei18n/never-say-never
Never say never
2016-08-01 14:11:46 -07:00
James Godfrey-Kittle
daaa1bd06f Report number of segments in result, not points (#41)
For some reason, I was subtracting 1 from the spline lengths in the
test report. Not sure why that is, so I've assumed it was wrong (and
now we subtract 2 to get the length in number of segments).
2016-08-01 14:08:26 -07:00
Behdad Esfahbod
17b034c904 In curves_to_quadratic(), avoid some more work
When a curve fails to convert at a certain n, keep increasing n for
this curve until a fit found.  Saves another 7% in the benchmark.
2016-07-29 20:31:38 -07:00
Behdad Esfahbod
06eb980a0c Split off case of n=1 into its own function
Looks like changes like this don't have measurable performance
penalty, but they do help with analyzing profile output to see
which branch (n=1 or n!=1) takes more time.
2016-07-29 20:31:38 -07:00
Behdad Esfahbod
96eb3baa15 Add specialization of split_cubic_into_n() for n=6
...by calling split_cubic_into_three() twice.  Gives another 5..9%
speedup.  The thing is, while higher n values are lower-frequency,
the savings are also bigger.  So the two offset out.
2016-07-29 20:31:38 -07:00
Behdad Esfahbod
6d811003ed Add specialization of split_cubic_into_n() for n=4
...by calling split_cubic_into_two() twice.  Gives another 5% speedup.
2016-07-29 20:31:38 -07:00
Behdad Esfahbod
44235274cd Remove variable that was used once. 2016-07-29 20:31:38 -07:00
Behdad Esfahbod
9080151cd5 [varLib] Fix variations for composite glyphs using anchor points 2016-07-29 14:44:02 -07:00
Behdad Esfahbod
fc05fe74ec [varLib] Remove unused code 2016-07-29 14:40:16 -07:00
Behdad Esfahbod
02b415c237 [bezierTools] Speed up a bit 2016-07-29 14:40:10 -07:00
Behdad Esfahbod
d201c2c28b Merge pull request #38 from googlei18n/one-last-optimization
One last optimization
2016-07-28 18:04:57 -07:00
Behdad Esfahbod
f899c8ccf8 Combine two more loops
Another 10% speedup.
2016-07-28 17:37:18 -07:00
Behdad Esfahbod
c5a17bb055 Shuffle code in cubic_approx_spline() a bit 2016-07-28 17:10:49 -07:00
Behdad Esfahbod
b305ef49be Another micro-optimization 2016-07-28 16:31:30 -07:00
Behdad Esfahbod
40ebe85d9e Move special-cases of split_cubic_into_n() into it
Surprisingly this doesn't seem to slow down, but also slightly
speed up.
2016-07-28 16:25:58 -07:00
Behdad Esfahbod
ede89847a7 Apply review changes from https://github.com/googlei18n/cu2qu/pull/37 2016-07-28 16:12:00 -07:00
Behdad Esfahbod
701105098b Merge pull request #37 from googlei18n/break-early
Break early
2016-07-28 16:10:13 -07:00
Behdad Esfahbod
223450e8d7 Break out of conversion loop early if a curve fails to convert
Makes the compatible-conversion about 40% faster.
2016-07-28 14:41:33 -07:00
Behdad Esfahbod
39fbd9faba [benchmark] Make output more compact
Also, are the min numbers really useful?
2016-07-28 14:41:33 -07:00