1341 Commits

Author SHA1 Message Date
Jack McCabe
eeba234ee0 [subset] PR feedback implementation 2022-09-30 15:59:11 +01:00
Jack McCabe
14ce08bd75 [subset] extend CPALv1 test 2022-09-30 15:41:14 +01:00
Jack McCabe
70112b947d [subset] prevent CPAL nameIDs from being dropped 2022-09-30 12:36:28 +01:00
Jack McCabe
4901deab76 [subset] Add test for CPALv1 (failing !) 2022-09-30 12:10:56 +01:00
Cosimo Lupo
ea534a4ecf
unicodedata: Update Scripts/Blocks to Unicode 15.0
by re-running the MetaTools/buildUCD.py script using the current UCD
database.
2022-09-23 10:42:55 +01: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
Cosimo Lupo
87bbb64061
[instancer] downgrade GSUB/GPOS version if there are no FeatureVariations after instancing
same as https://github.com/fonttools/fonttools/pull/2811 but moved the logic to _instantiateFeatureVariations directly, instead of after it
2022-09-13 10:44:26 +01:00
Cosimo Lupo
964df076e1 varLib_test: test we don't add no-op DeltaSetIndexMap when not needed
https://github.com/fonttools/fonttools/issues/2800
2022-09-05 17:15:51 +01:00
Simon Cozens
64fd837ca1
Allow multiple value record types in the same pairpos table (#2776)
* Use buildPairPosClassesSubtable's ability to promote value records (see #2772)

* Add tests for #2772
2022-09-05 14:44:50 +01:00
Harry Dalton
bbb26c2cea Confirm split functions can handle unbounded conditions with absent keys
As we make an effort to support conditions with "minimum" or "maximum"
absent, as well as with "minimum" or "maximum" None, this commit
confirms that the split functions can handle these to some degree also.
2022-09-01 17:34:51 +01:00
Harry Dalton
d1ec8e6979 Test that DS5 splitting code handles unbounded conditions gracefully
Conditions with unbounded values have a "minimum" or "maximum" value of
None.

These tests check that:
a) The public-facing split functions can receive None values without
     crashing; and
b) That their internal helper functions correctly translate the None
     values to math.inf and -math.inf to express them.

These tests are expected to fail, indicating where a fix is required.
2022-09-01 13:41:44 +01: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
d5db47e09d minor cleanup 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
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