1742 Commits

Author SHA1 Message Date
Cosimo Lupo
0068f78b9a varStore_test: shuffle input order to test algorithm is stable 2025-02-07 11:06:57 +00:00
Cosimo Lupo
307b31250d
Merge pull request #3758 from fonttools/DeltaValue
[otData] Fix DeltaValue repeat value
2025-02-04 10:44:17 +00:00
Cosimo Lupo
5b3176f4fd add test for parsing and compiling DeviceTable's DeltaValue 2025-02-04 10:37:27 +00:00
Jens Kutilek
2e13c733c8 Remove unneeded check, adjust tests 2025-02-03 12:23:10 +00:00
Cosimo Lupo
eece3c1b62
Merge pull request #3756 from cmyr/unicode-data-fixup
[unicodedata] Fix bug in buildUCD.py
2025-01-29 17:35:33 +00:00
Colin Rofls
b26271cc4d [unicodedata] Fix bug in buildUCD.py
The method that was being used to read the header from the input was
inadvertently dropping the first non-header line on the floor; although
this happens to be okay in some cases (where there is an empty line
after the header) in the case of newer versions of the
ScriptExtensions.txt file, this was causing the generated code to be
missing the first entry, for U+00B7 (MIDDLE DOT)
2025-01-29 11:53:58 -05:00
Cosimo Lupo
e02349c7ce [ttGlyphPen_test] Add bounds test for 'nested' composite glyph
This is a regression introduced with https://github.com/fonttools/fonttools/pull/3750

The test currently fails because we are now applying rounding to the
coordinates extracted from each component of a composite glyph, *before*
these are transformed; with nested components of components with non trivial transforms, the rounding errors compound leading to incorrect bounds.
2025-01-24 15:04:42 +00:00
Cosimo Lupo
cf20a14453
Merge pull request #3750 from fonttools/recalcBounds-round-coords
[glyf] fix bbox of transformed components with un-rounded coordinates
2025-01-23 11:26:50 +00:00
Cosimo Lupo
6ea7f5e2a6 [ttGlyphPen_test] add repro for googlefonts/fontc#1206
the test makes sure that the bounding box of composite glyph with non trivial transform pointing to base glyphs with un-rounded floating-point coordinates, still get their bounding box computed on the rounded-off integer coordinates.

see https://github.com/googlefonts/fontc/issues/1206
2025-01-23 11:06:28 +00:00
Colin Rofls
6bc5d7f887 [feaLib] Allow duplicate script/language statements
And accumulate all of the declared lookups into the appropriate feature.
2025-01-22 12:58:44 -05:00
Cosimo Lupo
49cd3c3265
Merge pull request #3732 from andrewsuzuki/fix-name-table-names-attr
Ensure names attr exists on table__n_a_m_e
2025-01-21 14:00:44 +00:00
Colin Rofls
fc32bca017 [bezierTools] Improve robustness of splitCubicAtT 2025-01-17 12:20:29 -05:00
Harry Dalton
0b3ac6e9ae Merge tests with the same name, to prevent one being obscured 2025-01-03 13:16:17 -07:00
Andrew Suzuki
68dbfba5c4 Ensure names attr exists on table__n_a_m_e 2024-12-22 10:44:06 -05:00
Colin Rofls
4b9f5ef605 [feaLib] More efficient inline format 4 lookups
With this patch we will now reuse lookups more frequently when a
contextual lookup has inline ligature substitution rules.
2024-12-10 09:51:05 -07:00
Behdad Esfahbod
1be0440c55 [Tests] Don't compare numbers with "is" 2024-12-10 02:28:51 -07:00
خالد حسني (Khaled Hosny)
26590d3d6e
[feaLib] Don’t modify variable anchors in place (#3717)
When passing a parsed feature file that has variable anchors to
addOpenTypeFeatures(), builder would modify the anchors in place and
discard the variations, which break any subsequent use of the feature
file.

I encountered this building a font that has variable cursing anchors
with ufo2ft. The cursFeatureWriter would write the variable anchors, but
then when kernFeatreWriter compiles the file to get GSUB closure, the
variation would be dropped from the anchors, and later when when the
feature data is compiled into the font, the anchors would be compiled
without variations.
2024-12-05 12:09:44 +00:00
Behdad Esfahbod
756c893b84 [Tests] Add pytest.approx() to a test
Fixes https://github.com/fonttools/fonttools/issues/3696
2024-11-21 12:26:54 -07:00
Cosimo Lupo
b371f23760 fontBuilder: don't add mac names for fvar and STAT if name table hasn't any 2024-11-14 12:57:44 +01:00
Cosimo Lupo
d2ce6e075c check for mac names in buildVFStatTable for DSv5 sources with STAT data 2024-11-14 12:57:44 +01:00
rsheeter
991e7914e3 Lets not add inconsistent names? 2024-11-13 16:17:56 -08:00
Behdad Esfahbod
4e2968462a [specializer_test] Simplify tests
No need to go to string and back...
2024-11-12 19:44:50 -07:00
Behdad Esfahbod
6f37252e85 [specializer_test] Remove unused variable 2024-11-12 19:38:11 -07:00
Behdad Esfahbod
7457f8ac52 [specializer_test] Speed up test
No need to test 2000 ops. Just 600, anything higher than the max
stack depth (514) is as good...
2024-11-12 19:29:13 -07:00
Behdad Esfahbod
b54936400e [cffLib.specializer_test] Do less work
No need to generalizeFirst these. The tests are in the
general form.
2024-11-12 19:23:00 -07:00
Behdad Esfahbod
cfba1f995f [cffLib.specializer] Make command-merging linear again
The consideration for blends had made it into O(n^2).
Make it linear again.

Speeds up Tests/cffLib/specializer_test.py::CFFSpecializeProgramTest::test_maxstack_blends
3x for me.
2024-11-12 18:43:03 -07:00
Behdad Esfahbod
7e6d31569f [cffLib.specializer] Adjust stack use calculation
See comment.
2024-11-12 17:47:52 -07:00
Behdad Esfahbod
f1d3e116d5
Merge pull request #3672 from googlefonts/cmap14
[subset] consider variation selectors subsetting cmap14
2024-11-11 13:45:36 -07:00
Behdad Esfahbod
dafb6d26a0
Merge pull request #3679 from fonttools/cff2-specializer-maxStack
[CFF2] specializer fix stack overflow
2024-11-08 10:51:04 -07:00
Behdad Esfahbod
bb7a29e81a [cffLib.specializer] Fix more stack-overflow opportunity
I think it's solid now.
2024-11-06 19:13:35 -05:00
Behdad Esfahbod
2e96d81b05 [specializer_test] Add a test for blend stack-use after specialize() 2024-11-06 18:25:03 -05:00
Behdad Esfahbod
3a909a07fa [specializer_test] Parametrize copy/pasta tests 2024-11-06 17:49:52 -05:00
Behdad Esfahbod
49bcd19bd9 [specializer_test] Remove Python2 remnants 2024-11-06 16:23:58 -05:00
ftCLI
2906e4043d Add test for reorderGlyphs function with CFF fonts 2024-11-05 17:39:57 +01:00
Behdad Esfahbod
2e8a67696f [interpolatable_test] Don't test CFF2 on Python 3.8
It's mysteriously failing:
https://github.com/fonttools/fonttools/pull/3670#issuecomment-2445055495
2024-11-04 11:13:42 -07:00
Behdad Esfahbod
b5373bf5d2 [varLib.interpolatable] Support CFF2 input font
Fixes https://github.com/fonttools/fonttools/issues/3666
2024-11-04 11:13:42 -07:00
Garret Rieger
201f02c2c2 [subset] Fix lint. 2024-10-24 00:30:38 +00:00
Garret Rieger
edaab1fa2f [subset] Add tests for UVS + cmap14 subsetting. 2024-10-23 22:19:06 +00:00
Cosimo Lupo
dd8d80a4f2
Merge pull request #3561 from drj11/drj11/unicode-hex
Check unicode elements have required hex attribute
2024-10-15 16:39:12 +02:00
Khaled Hosny
f7ecc6fe65 [removeOverlaps] Add test for handling CFF.Private.nominalWidthX
The test currently fails because we don’t take CFF.Private.nominalWidthX
into account when creating new CharString after overlap removal.
2024-10-12 01:21:59 +03:00
Behdad Esfahbod
e8146a6d07 [glyf] Add optimizeSize option
Set to True by default. Can be turned to False on the table,
or at Glyph() compile time.

Also fixes Glyph's draw() to expand the glyph first. Otherwise
it was failing.
2024-10-11 08:31:31 -06:00
Behdad Esfahbod
0213bea88e [TupleVariation] Option to optimize for loading speed, not size 2024-10-06 18:11:48 -06:00
Behdad Esfahbod
10a61ef7de Update to Unicode 16 2024-09-23 08:46:56 -06:00
Harry Dalton
a43def09c2 Add regression test for #3634
ttx is based on reproduction process in initial issue.
2024-09-15 12:10:29 -07:00
Cosimo Lupo
00ad60b4c3
subset_test: add failing test to reproduce issue #3616
If we subset this test font (a subset of Google Fonts' Andika-Regular.ttf) and request to keep 'cv43', only the FirstParaUILabelNameID (324) is currently kept, the other two (325 amd 326) get incorectly dropped.
All referenced nameIDs should be kept.

This will be fixed with https://github.com/fonttools/fonttools/pull/3617

```
>       assert nameIDs == keepNameIDs
E       assert {0, 1, 2, 3, 4, 5, 6, 321, 322, 323, 324} == {0, 1, 2, 3, 4, 5, 6, 321, 322, 323, 324, 325, 326}
E         Extra items in the right set:
E         325
E         326
E         Full diff:
E         - {0, 1, 2, 3, 4, 5, 6, 321, 322, 323, 324, 325, 326}
E         ?                                         ----------
E         + {0, 1, 2, 3, 4, 5, 6, 321, 322, 323, 324}
```
2024-08-30 18:13:44 +01:00
Behdad Esfahbod
dab890e681 [varLib.avar] Add another test 2024-08-30 08:46:50 -07:00
Behdad Esfahbod
8d58f7f730 [varLib.avar] Add roundtrip test
Fails currently.
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
2742c6287c [varLib.avar] Test & fix _pruneLocations 2024-08-30 08:46:50 -07:00
Behdad Esfahbod
ecd2d8e559 [Tests] Do not require fonttools command to be available
I typically run tests like:

$ python setup.py build_ext -i && PYTHONPATH=Lib pytest

Previously, this particular test and only this, required
that a `pip install -e .` has had happened. Not anymore.
2024-08-20 10:58:55 -06:00
Behdad Esfahbod
0c2652011e [varLib.models] By default, assume OpenType-like normalized space
See:
https://github.com/fonttools/fonttools/pull/2846#issuecomment-2267750076

I *think* this is an improvement, and no one should have been relying
on the broken existing behavior.

Docs need updating.
2024-08-16 18:45:08 -06:00