Nikolaus Waxweiler
d584daa8fd
Blacken code
2022-12-13 11:26:36 +00:00
Cosimo Lupo
b4e664da21
[woff2] Add support for encoding/decoding OVERLAP_SIMPLE glyf flags in WOFF2
...
Fixes #2576
This updates our woff2 encoder/decoder to support retaining the OVERLAP_SIMPLE glyf flag following the updated WOFF 2.0 specification and official google/woff2 implementation.
https://www.w3.org/TR/WOFF2/#glyf_table_format
2022-11-09 13:56:46 +00:00
Cosimo Lupo
12bf60aee0
woff2_test: [minor] remove unused local variable
2022-11-09 11:08:37 +00:00
Cosimo Lupo
04b43ed833
woff2_test: fix test_hmtx_compressed test
...
it had been failing after we renamed a name string containing 'master' => 'main; in https://github.com/fonttools/fonttools/pull/2883
2022-11-09 11:06:04 +00:00
Khaled Hosny
232b2ccbc4
Move the rest of py23 module to textTools
...
Change all imports to use textTools module, except the test_py23.py test
which is kept until we decide to remove the module (if ever).
2021-08-20 01:29:45 +02:00
Just van Rossum
5fc65d7168
Misc py23 cleanups ( #2243 )
...
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00
Nikolaus Waxweiler
8569a8435f
Update Tests/ttLib/woff2_test.py
...
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
2021-01-28 16:35:36 +00:00
Nikolaus Waxweiler
52e3e03ed9
An off-curve should stay off even with flags
2021-01-28 16:30:23 +00:00
Tim Gates
56310f38cf
docs: fix simple typo, ovverride -> override
...
There is a small typo in Tests/ttLib/woff2_test.py.
Should read `override` rather than `ovverride`.
2020-12-28 09:06:44 +11:00
Seth Michael Larson
d5353a4085
Switch from brotlipy to brotlicffi for PyPy support
2020-12-01 19:37:02 -06:00
Cosimo Lupo
0d53cfbb99
woff2_test: add test with CBDT/CBLC font without glyf/loca tables
2020-02-26 18:24:53 +00: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
3f6a381132
woff2_test: add tests for main() console entry point
2019-06-14 18:30:32 +01:00
Cosimo Lupo
8bd83f36bd
woff2_test: add tests for transformed hmtx and untransformed glyf+loca
2019-06-13 18:46:46 +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
6b0e350a06
woff2_test: remove test for no longer reserved bits 6-7
2019-06-11 15:23:58 +01:00
Cosimo Lupo
9af92fdb41
woff2_test: fix up flaky tests
...
some tests were failing when shuffling the order of the tests with
pytest-randomly. That's because calling TTFont.getTableData method
on 'loca' table before having compiled 'glyf' returns an empty b""
string.
2019-06-11 13:22:38 +01:00
Sascha Brawer
6a7e299c09
Fix “DeprecationWarning: invalid escape sequence” in Python 3.7
2019-01-22 16:36:15 +01:00
Cosimo Lupo
c2263c2e8f
[woff2_test] use bytes instead of unicode literals in struct format strings
...
This is for compatiblity with Python older than 2.7.7.
See https://bugs.python.org/issue19099
> Issue #19099 : The struct module now supports Unicode format strings.
https://hg.python.org/cpython/raw-file/f89216059edf/Misc/NEWS
2017-02-21 14:31:57 +00:00
Cosimo Lupo
ae6059e234
[Tests] covert woff2 doctests to unittest and moved to woff2_test.py
2017-01-17 13:39:36 +00:00
Cosimo Lupo
3cdc800873
[Tests] rename all 'testdata' folders to simply 'data'
...
as it's now obvious what kind of data they are
2017-01-17 13:33:46 +00:00
Cosimo Lupo
e1d340cc65
[Tests] use absolute imports and add __init__.py where relevant
...
We can't use relative imports any more since the tests are now located outside the package.
I had to add __init__.py to Tests/feaLib/ so that pytest does not get confused by the presence
of two test files with the same basename: i.e. Tests/feaLib/builder_test.py and Tests/feaLib/builder_test.py
https://github.com/pytest-dev/pytest/issues/774
http://stackoverflow.com/questions/12582503/py-test-test-discovery-failure-when-tests-in-different-directories-are-called
2017-01-16 09:14:13 +00:00
Cosimo Lupo
78ad48eaf3
Move all *_test.py modules and test data to external Tests/ folder
2017-01-16 09:14:12 +00:00