1317 Commits

Author SHA1 Message Date
Behdad Esfahbod
f0f7b93f11 [varLib.models_test] Add test
from https://github.com/fonttools/fonttools/issues/2764
2022-08-23 10:32:57 -06:00
Cosimo Lupo
f5933c1cfa Revert "[varLib.models] Generate narrower tents"
This reverts commit 688939394b8cae3b2a0d5747e435cbd828a14531.
2022-08-23 17:20:57 +01:00
Behdad Esfahbod
bad70c68ef [varLib] Support extrapolation
Fixes https://github.com/fonttools/fonttools/issues/1252
2022-08-23 09:56:33 -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
68f31b580c
Merge pull request #2755 from fonttools/scaleUpem-cff
[scaleUpem] Support CFF/CFF2
2022-08-22 06:23:54 -06:00
Behdad Esfahbod
82a523cc17 [subset/CFF] Remove FDSelect workaround from 2014
Fixes https://github.com/fonttools/fonttools/issues/139
2022-08-20 02:41:24 +02: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
31e6bcfc31 [visitor_test] Test defaultStop=True 2022-08-17 14:30:13 -06:00
Behdad Esfahbod
d6bdae1369 [visitor_test] Test enums 2022-08-17 14:27:58 -06:00
Behdad Esfahbod
596c571c1c Add ttVisitor test 2022-08-16 13:08:03 -06:00
Behdad Esfahbod
32904d43bb [models_test] Add tests from Just 2022-08-16 12:46:44 -06:00
Behdad Esfahbod
3325b47606
Merge pull request #2717 from fonttools/varLib-narrow
[varLib.models] Generate narrower tents
2022-08-16 12:46:22 -06:00
Behdad Esfahbod
8fdf4d160e [visitor_test] Add visitor tests 2022-08-16 12:28:26 -06:00
Behdad Esfahbod
fcc4a875dd Rename visitor_test to Snippets/scale-font.py 2022-08-15 12:51:07 -06:00
Behdad Esfahbod
3e82ce1e2d [visitor_test] Take scaleFactor 2022-08-15 12:50:16 -06:00
Behdad Esfahbod
be7df107e2 [visitor_test] Implement glyf table visiting 2022-08-15 12:47:17 -06:00
Behdad Esfahbod
a0686e8d2e [visitor] Add register_attr(s) example 2022-08-15 12:37:38 -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
Behdad Esfahbod
03d264756b
Test var model error (#2217)
* [varLib.models] Add test for modeling rounding error

Tests https://github.com/fonttools/fonttools/pull/2214

If you flip demo to True, it does a slower test and demos the new error as well
as the error the old code was producing (ie. rounding deltas post-modeling).

Indeed, the new error is always capped by 0.5 as expected, whereas the old one
was unbounded. Here's the worst-case error of the bad code:

...
240     0.42    4.8
...

240 is just the line number. 0.42 is new error. 4.8 is old error.

* turn test_modeling_error into a parametrized pytest test

Like the other test methods in the same module, all those whose name starts with 'test_' are automatically discovered and run by pytest which is our default test runner. So there is no need to call the test method itself in the top-level module scope. One simply runs the test via pytest. To execute this specific test method one can do 'pytest Tests/varLib/models_test.py::test_modeling_error'.

* use pytest markers to mark specific test as 'slow'

So that one can optionally deselect tests marked with specific marker by passing -m option (e.g. to deselect 'slow' tests, pytest -m 'not slow' ...).

https://docs.pytest.org/en/stable/mark.html#registering-marks
https://docs.pytest.org/en/stable/example/parametrize.html#set-marks-or-test-id-for-individual-parametrized-test

* [varLib/models_test] Comment out non-test code

Co-authored-by: Cosimo Lupo <clupo@google.com>
2022-08-15 10:30:45 -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
Cosimo Lupo
87e86cb5fb
Merge pull request #2731 from fonttools/pyup-scheduled-update-2022-08-08
Scheduled weekly dependency update for week 32
2022-08-15 11:33:37 +01:00
Cosimo Lupo
0f33634a9e subset_test: fix mock test with uharfbuzz>=0.30 new 'repack_with_tag' method 2022-08-15 12:10:13 +02:00
Behdad Esfahbod
e31b214089 [visitor_test] Make it into the start of a font rescaler 2022-08-14 14:43:28 -06:00
Behdad Esfahbod
688939394b [varLib.models] Generate narrower tents
Based on https://github.com/fonttools/fonttools/pull/2218
but modify the general solver instead.
2022-08-14 14:00:09 -06:00
Behdad Esfahbod
26ae03f58f [ttGlyphSet] Add tests 2022-08-14 12:52:49 -06:00
Behdad Esfahbod
cdc5307d1b
[merge] Use '.' instead of '#' in duplicate glyph names (#2742)
Fixes https://github.com/fonttools/fonttools/issues/1950
2022-08-14 12:49:35 -06:00
Behdad Esfahbod
8fe672c6a2 Add misc.visitor.py
Fixes https://github.com/fonttools/fonttools/issues/1959
2022-07-31 12:27:09 -06:00
Cosimo Lupo
d5dd4d297f subset_test: catch ImportError instead of ModuleNotFoundError 2022-07-18 12:17:35 +02:00
Jany Belluz
b5f9499d2d [designspaceLib] Don't make up bad PS names when no STAT data
See GitHub issue: https://github.com/googlefonts/ufo2ft/issues/630
2022-07-07 11:56:51 +01:00
Cosimo Lupo
b8333d9ade instancer_test: revert expected result to before, to match eab9aa5 2022-07-06 16:50:22 +01:00
Cosimo Lupo
14f88fb781 Fix cu2quPen_test.py for python 3.11
Credits to pnamade from https://github.com/fonttools/fonttools/pull/2655
2022-07-06 11:16:02 +01:00
Nikolaus Waxweiler
ce38db6562
Merge pull request #2673 from daltonmaag/instancer-set-bits
Set RIBBI bits when cutting instances
2022-07-06 11:01:08 +01:00
Cosimo Lupo
2a07518b70
Merge pull request #2660 from fonttools/variable-colr
[varLib] add support for building variable COLR from set of master COLRv1 tables
2022-07-06 10:55:50 +01:00
Cosimo Lupo
46e780ffa2
Merge pull request #2668 from googlefonts/hb_repack
Update how table packing falls back to fontTools from harfbuzz.
2022-07-06 10:49:39 +01:00
Cosimo Lupo
f1d715dbb1 Add integration test for variable COLR in varLib_test.py 2022-07-06 10:24:16 +01:00
Cosimo Lupo
ef3775a084 merger_test: add test for expandPaintColrLayers method 2022-07-06 09:59:16 +01:00
Cosimo Lupo
fd397bac32 merger_test: test with masters' layer reuse off and on to confirm output is the same 2022-07-06 09:14:17 +01:00
Cosimo Lupo
8a9f16d129 COLRVariationMerger: copy destination layers to ensure they are unique and can be modified in place 2022-07-05 17:53:39 +01:00
Nikolaus Waxweiler
16d899a2be Apply RIBBI bits to all kinds of fonts 2022-07-05 15:45:44 +01:00
Cosimo Lupo
e5029801d2 support merging COLR masters with 'sparse' glyphsets or different layer count
There is no longer a requirement that all the masters have exactly the same base color glyphs as the default masters. Similarly, it's no longer required that all masters' LayerLists have the same total count of layers. It is sufficient that, for a base color glyph in the default master, a non-default master may (or may not) contain one with the same name and same effective number of layers (which in turn can be laid out differently in the respective LayerLists).
This provides greater flexibility when working with variable font project with sparse glyph sets.
2022-07-05 00:11:12 +01:00
Cosimo Lupo
a3f402e036 move build_n_ary_tree to misc/treeTools.py module
so I can import from varLib.merger as well
2022-07-04 23:08:14 +01:00
Cosimo Lupo
3b0769b519 colorLib: let clipBoxes contain more glyphs than colorGlyphs, helps with sparse variable builds 2022-07-04 18:44:54 +01:00
David Corbett
8ec37c4bb3 [feaLib] Let the parser set nameIDs 1 through 6 2022-07-02 15:23:03 -04:00
Cosimo Lupo
c2887caf95 varLib/merger_test: test merging ClipBoxes 2022-06-28 18:23:06 +01:00
Cosimo Lupo
d85aa2d119 COLRVariationMerger: further optimize DeltaSetIndexMap
previously we only reused the VarIndexBase of a previously seen variable table when the current's varIdxes were _fully_ equal to one of the previous; now we also try to find a match anywhere in the accummulated list of self.varIdxes, including a partial match at the tail of the list.
2022-06-28 14:11:28 +01:00