326 Commits

Author SHA1 Message Date
Behdad Esfahbod
e07fafc324 [scaleUpem_test.py] Scale other varComposite font as well
Just because it's there.
2023-02-01 19:06:10 -07:00
Behdad Esfahbod
2c2a0964d7 [ttGlyphSet_test] Add another varComposite test
This one has different characteristics, hitting more code.
2023-02-01 18:56:31 -07:00
Behdad Esfahbod
1d072aa30e [scaleUpem_test] Also test readint varComposite XML
Easiest place to test it. I know...
2023-02-01 18:39:20 -07:00
Behdad Esfahbod
f3dd3fb48f [ttGlyphSet_test] Use variations in varComposite test
To hit more code with test.
2023-02-01 18:31:54 -07:00
Behdad Esfahbod
6755acceee [woff2] Add fvar to glyf dependencies
Since the VarComposites added fvar to glyf dependencies in ttLib.

Add test for VarComposite to woff2 tests.
2023-01-31 12:46:17 -07:00
Behdad Esfahbod
63d355e37d [Tests/ttGlyphSet/VarComposite] Add test
And a bugfix.
2023-01-30 11:26:21 -07:00
Behdad Esfahbod
f2cf4eea73 [Tests/scaleUpem/VarComposite] Add test 2023-01-30 11:26:21 -07:00
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
Parag Nemade
0a176acabc
Update branch name from master to main 2022-11-09 10:11:02 +05:30
Behdad Esfahbod
5a9b044617 [scaleUpem] Fix test 2022-10-04 12:43:39 -06:00
Just van Rossum
6e6b86d41a [ttGlyphSet] Add comment to clarify the test 2022-09-20 11:17:58 +02:00
Just van Rossum
fa4a5f33b4 Add test case 2022-09-20 10:54:09 +02:00
Miguel Sousa
1306a71db3
Merge pull request #2786 from fonttools/msousa-bad-post-format-1
Don't crash when `post` format 1 is improperly used
2022-08-31 08:52:49 -07:00
Miguel Sousa
96c9250cf8 Update warning message [skip ci] 2022-08-31 08:52:17 -07: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
Miguel Sousa
a2efac012c Add warning log 2022-08-30 23:56:03 -07:00
Miguel Sousa
0e9c48e6ab Don't crash when post format 1 is improperly used
Fixes #2736
2022-08-30 09:14:03 -07:00
Just van Rossum
b1441c583b Add test for non-VF exception 2022-08-30 09:26:16 +02:00
Just van Rossum
da539e5c4d use fixture for test font 2022-08-30 08:56:24 +02:00
Just van Rossum
86e4f2bf94 test file for font.normalizeLocation() 2022-08-30 08:49:36 +02:00
Just van Rossum
d2f0611fea test font.normalizeLocation() 2022-08-30 08:49:36 +02:00
Just van Rossum
b818e1494f Refactor ttGlyphSet.py
- only differentiate between glyf and CFF/CFF2 implementations, not var vs non-var
- use collections.abc.Mapping to get a more consistent dict-like object with less code
- prefer HVAR metrics over gvar metrics
- move some responsibilities from the _TTGlyphSet objects to the _TTGlyph objects
- adjust some tests to the changes
2022-08-30 08:49:36 +02:00
Behdad Esfahbod
b3d6868516 [ttGlyphSet_test] Test CFF2 variations 2022-08-26 21:42:14 -06:00
Cosimo Lupo
0adc164355
Merge pull request #2762 from fonttools/var-glyph-set-inheritance
[ttGlyphSet] Inherit ttVarGlyphSet from ttGlyphSet
2022-08-22 17:24:05 +01:00
Cosimo Lupo
320cbf7c47 [ttGlyphSet] Inherit ttVarGlyphSet from ttGlyphSet
Fixes #2759
2022-08-22 17:07:31 +01:00
Behdad Esfahbod
6287fb2917 [scaleUpem_test] Test otf scaling doesn't crash
The ttx output for this is over 700kb so didn't add expected.
2022-08-19 11:07:25 -06:00
Behdad Esfahbod
d275207dbc Add scaleUpem_test 2022-08-18 06:40:39 -06:00
Behdad Esfahbod
376caff386
Merge pull request #2718 from fonttools/visitor
Add fontTools.misc.visitor, fontTools.ttLib.ttVisitor, ttLib.scaleUpem, Snippets/print-json.py
2022-08-18 06:12:19 -06:00
Behdad Esfahbod
9e1f447934 [ttVisitor_test] More meaningful testing 2022-08-17 14:37:45 -06:00
Behdad Esfahbod
596c571c1c Add ttVisitor test 2022-08-16 13:08:03 -06:00
Behdad Esfahbod
41e6f60011
Merge pull request #2738 from fonttools/glyphset
TTVarGlyphset
2022-08-15 11:07:41 -06:00
Behdad Esfahbod
dc99ab6b3f [ttGlyphSet] Address review comments 2022-08-15 11:06:51 -06: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
Behdad Esfahbod
26ae03f58f [ttGlyphSet] Add tests 2022-08-14 12:52:49 -06: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
Cosimo Lupo
6e0cebc487 ttFont_test: add test for ensureDecompiled 2022-03-17 17:13:50 +00:00
Cosimo Lupo
83ee6bcdab ttCollection: don't close file inside init if lazy=True
Fixes 'seek of closed file' error #2549
2022-03-17 12:30:40 +00:00
Cosimo Lupo
e1b3bfc807 ttCollection_test: check loading TTCollection with lazy attribute
currently lazy=True fails with 'ValueError: seek of closed file'
2022-03-17 11:43:11 +00:00
Cosimo Lupo
e726217ae0 ttFont_test: add test for setGlyphOrder updating glyf.glyphOrder 2022-03-10 17:43:02 +00: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