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
Simon Cozens
f676472ff3
Test for visitor inheritance
2024-07-03 06:48:38 -06:00
David Corbett
aa390ec98b
Fix OS/2.usMaxContext for reverse GSUB rules
2024-06-16 20:37:17 -07:00
David Jones
7d39064a36
Fix oops: GLIF2 test should have format=2
2024-06-03 17:09:54 +01:00
Cosimo Lupo
97929b3236
[feaLib] try reuse existing inline chained multiple subst lookups when possible
...
We already do this for inline single substitutions in chained contextual lookups, this PR extends this for multiple substitutions as well.
Fixes https://github.com/fonttools/fonttools/issues/3551
2024-06-03 17:06:46 +01:00
David Jones
c7be064ef6
Test absent hex attribute on unicode element
...
(currently fails)
2024-06-03 17:01:20 +01:00
Behdad Esfahbod
1536efc22e
[CFFToCFF2] Add a test
...
Exercises:
https://github.com/fonttools/fonttools/pull/3518#discussion_r1611033728
2024-05-25 10:15:00 -06:00
Behdad Esfahbod
2ea20f9572
[bezierTools] Add a test
2024-05-24 10:36:46 -06:00
Behdad Esfahbod
db60a248dc
Merge pull request #3395 from fonttools/varc-table
...
[VARC] Variable Composites table
2024-05-24 08:09:51 -07:00
Cosimo Lupo
0902d1e482
[feaLib] don't reference same lookup multiple times within the same feature
...
Fixes https://github.com/fonttools/fonttools/issues/2946
2024-05-23 19:00:39 +01:00
Behdad Esfahbod
973dc5c9a7
[varc] Use Condition instead of ConditionSet
...
With more Condition formats.
df7dcc4618
https://github.com/harfbuzz/boring-expansion-spec/issues/147
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
9cb73dafeb
[varc] Add a conditional VarComponent test
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
74f870f4ef
[varc] Add ConditionSets
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
88828e0082
[CFF2IndexOf] Fix data_base
...
From the spec:
"Offsets in the offset array are relative to the byte
that precedes the object data."
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
5b2df6b90b
[VARC] Compute flags from XML transform components
2024-05-22 18:46:07 -06:00