272 Commits

Author SHA1 Message Date
Behdad Esfahbod
a99e130b26 [Tests] Silence a few deprecation warnings 2023-05-24 14:38:41 -06:00
Jens Kutilek
85c80be6b6
Fix missing composite instructions in ttx (#3092)
* Fix calculation of haveInstructions
* Add test
2023-04-25 16:21:24 +02:00
Behdad Esfahbod
05872d6878
Merge pull request #2679 from fonttools/avar2
Avar2
2023-03-15 11:56:30 -06:00
Behdad Esfahbod
2edbbc1b32 [avar2] Test xml for equality 2023-03-15 11:46:57 -06:00
Behdad Esfahbod
b009e63733 [avar2] Use fl2fi in test 2023-03-15 11:40:24 -06:00
Behdad Esfahbod
1deed38b8d [avar2] Add compile test 2023-03-14 14:09:32 -06:00
Jens Kutilek
f1a75bacb2
Handle string input to Program.fromAssembly() (#3038)
* Add tests for fromAssembly() output (#3036)
* Handle string input to fromAssembly() (Fixes #3036)
* Fixups suggested by @anthrotype
* Add some more typing annotations
* Program.assembly always returns List[str] now
* Add annotation for bytecode
* Move code from setter to fromAssembly
* Remove property
* Fix attribute names
2023-03-14 14:51:16 +01:00
Cosimo Lupo
c5e464ad8f
C_O_L_R_test: add tests for computeClipBoxes
using a subset from test_glyphs font from the googlefonts/color-fonts repository
2023-03-10 15:23:30 +00:00
Behdad Esfahbod
43b16df8db [avar] Update test expectations 2023-03-08 11:10:07 -07:00
Behdad Esfahbod
2b5686205e [avar] Support previous API in compile/decompile
Using the otData mechanism with handcoded shim.
2023-03-08 09:29:58 -07:00
Johannes Neumeier
f52b3da721 Make NameRecord comparison not fail on encoding errors #3006 2023-02-24 15:58:53 +02:00
Behdad Esfahbod
568dd0c5d4 [glyf] Support and test cubic spline 2023-02-21 13:01:49 -07:00
Behdad Esfahbod
9df8e6dd64 Add missing test file 2023-02-21 13:01:49 -07:00
Behdad Esfahbod
0a0b152c33 [glyf] Support, and add test for, all-offcurve cubic contour 2023-02-21 13:01:49 -07:00
Behdad Esfahbod
77e96bdcd9 [glyf_test] Add cubic test 2023-02-21 13:01:49 -07:00
Behdad Esfahbod
b7deb93647 Move VarComposite roundtrip tests to glyf_test 2023-02-06 11:09:11 -07:00
Behdad Esfahbod
4c201b9a42 [glyf/VarComposite] Implement padding trimming 2023-02-06 11:00:05 -07:00
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
Cosimo Lupo
36de9df3cc [gvar] be non lazy for TTFont.lazy=False, add ensureDecompiled
like cmap, or glyf or OTL tables, we need to respect lazy=False flag and decompile everything upfront, also we want to add an ensureDecompiled method (called by TTFont.ensureDecompiled) to allow loading everything in one go even when a font had been opened lazily.
2022-08-31 11:10:50 +01:00
Cosimo Lupo
1dffbae240 support proposed PaintSweepGradient's angles with +1.0 (180°) bias
In the upcoming draft of COLR spec, PaintSweepGradient's startAngle/endAngle are encoded with a +1.0 bias to allow for representation of a full +360° positive angle. Normal F2Dot14-fraction-of-half-circle angles can only represent angles between -360 <= angle < +360

This is a breaking change and will need to be coordinated with rendering implementations (at least FreeType/Skia).
2022-08-15 12:52:28 +02:00
Cosimo Lupo
676a66fad3 otTables: make DeltaSetIndexMap TTX dump less verbose by omitting no-op entries
though we still emit the empty <Map index=.../> elements; they help identify chunks of delta-set indices, and define the length of the array upon loading from XML
2022-06-21 17:27:11 +01:00
Cosimo Lupo
119b7732cc SVG: strip timestamp to make compressed gzip reproducible
we tell GzipFile to write the MTIME field to zero so that the compressed output is reproducible and doesn't change depending on when the data is compressed.
2022-06-09 16:29:29 +01:00
Cosimo Lupo
8673073a87 S_V_G__test: test compiling/decompiling compressed doc 2022-06-09 15:27:57 +01:00
Olli Meier
61ad06fc3a rename unittest with better name + get rid of redundant code 2022-02-11 17:51:52 +01:00
Olli Meier
1d51bc2b8e Changes as requested by Just. 2022-02-11 15:55:25 +01:00
Olli Meier
68fa3bbd47 Cleaning code based on feedback from Just 2022-02-10 22:13:58 +01:00
Olli Meier
384415f573
Update Tests/ttLib/tables/_n_a_m_e_test.py
Co-authored-by: Just van Rossum <justvanrossum@gmail.com>
2022-02-10 21:59:39 +01:00
Olli Meier
4a0b559caf
Update Tests/ttLib/tables/_n_a_m_e_test.py
Co-authored-by: Just van Rossum <justvanrossum@gmail.com>
2022-02-10 21:59:29 +01:00
Olli Meier
e968e8fd7f Based on the discussion with Just and anthrotype: Undo the changes in the name table and extend unittests. If there are inconsistencies in the name table, it's ok to create new name IDs, even if this might not be the most efficient way of creating the name table. 2022-02-10 21:24:51 +01:00
Olli Meier
51eda21b0a Adding more unittests, based on feedback. 2022-02-10 17:11:26 +01:00
Olli Meier
1649973800 Make use of 'Best' in names 2022-02-09 17:44:28 +01:00
Olli Meier
1a16b24cd5 Fix unittests 2022-02-09 17:17:11 +01:00
Olli Meier
c50f38ed0e extend name table with getFamilyName, getSubFamilyName and getNiceFullName + unittests 2022-02-09 17:06:02 +01:00
Cosimo Lupo
8d6a7617a2 minor: fix 4-space indentation from PR 2441 2021-11-08 12:27:26 +00:00
Rod S
7dd3488732 Traverse when there is no layer list 2021-11-06 14:26:27 -07:00
Cosimo Lupo
e3bc036c7e Add tests for SVG table 2021-10-13 14:53:00 +02: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
Cosimo Lupo
e161bbc980
Merge pull request #2384 from fonttools/newline-2021
Default to "\n" for newlinestr instead of None
2021-08-03 09:21:10 +01:00
Cosimo Lupo
094a40ca2e Revert "Deprecate and ignore newlinestr"
This reverts commit 5af178ac8eb2da79b965be5c6cee693dad602c65.
2021-08-03 10:00:13 +02:00
Cosimo Lupo
58ac5a9fd8 have ClipList and ClipBox format start at 1, not 0
b7e81fcbd6
2021-08-02 19:34:30 +02:00
Khaled Hosny
5af178ac8e Deprecate and ignore newlinestr 2021-07-30 04:31:19 +02:00
Khaled Hosny
000bf81700 Default to "\n" for newlinestr instead of None
If newlinestr is None, os.linesep is used, bu it is the third millennium
and we don’t need or want different line endings per-platform.
2021-07-30 04:12:33 +02:00
Cosimo Lupo
800bf85b2f add ClipList.Format so we can bump when we finally get >16bit GIDs
https://github.com/googlefonts/colr-gradients-spec/issues/346
2021-07-29 15:35:08 +02:00
Cosimo Lupo
bee2c85f61 [colrv1] otData: define ClipList, ClipBox, etc. 2021-07-28 18:04:48 +02:00
Cosimo Lupo
b74ffb4cda test roundtripping variable COLRv1 with a working VarIndexMap and VarStore 2021-07-23 17:27:57 +01:00
Cosimo Lupo
29a2ebf813 omit default VarIndexBase
4294967295 (0xFFFFFFFF in decimal form) is not very memorable.
Still, using hex notation for all VarIndexBases would make the non-default values less readable (when interpreted as an index into the DeltaSetIndexMap array, decimal makes more sense).
Since 0xFFFFFFFF means 'no variation data', it makes sense to omit it from the ttx dump and write an empty <VarIndexBase/> element with no value.
We also allow to build Var tables without needing to pass "VarIndexBase": 0xFFFFFFFF in the source dict.
2021-07-23 17:27:57 +01:00
Cosimo Lupo
6ba0163614 fix C_O_L_R_test.py following recent changes 2021-07-23 17:27:57 +01:00
Rod S
7225ac22a6 Update to reflect COLR v1 FWORD center and offset to transform 2021-07-06 17:47:56 +01:00
Cosimo Lupo
0e99474985 otData: reduce precision of specialized transforms, use F2Dot14 for all angles
https://github.com/googlefonts/colr-gradients-spec/pull/307 & https://github.com/googlefonts/colr-gradients-spec/pull/310
2021-07-06 17:47:56 +01:00
Cosimo Lupo
a0bd872f0e TupleVariation: make shared tuples order deterministic
most frequent first (like before https://github.com/fonttools/fonttools/pull/2351), only sort ties alphabetically
2021-07-02 12:52:54 +01:00