1699 Commits

Author SHA1 Message Date
Behdad Esfahbod
2ce45c2861 [bezierTools] Fix infinite-recursion in calcCubicArcLength
Fixes https://github.com/fonttools/fonttools/issues/3502
2024-05-07 08:54:42 -07:00
Behdad Esfahbod
d4fd62dc1e Fix build. Sorry 2024-04-30 13:28:57 -06:00
Behdad Esfahbod
705acc994f
Merge pull request #3473 from fonttools/avar2-modules
[avar2] Implement avar2 support in ttGlyphSet.
2024-04-06 07:59:22 -05:00
Behdad Esfahbod
2f80d6a176 [interpolatable] Remove obsolete comment
Well, it won't be true anymore when varc-table branch merges.
2024-04-02 13:28:45 -06:00
Behdad Esfahbod
d590feba99 [avar] Add test for ttGlyphSet support 2024-04-02 11:42:42 -06:00
Khaled Hosny
fae87446a8 Add some basic tests for reorderGlyphs 2024-03-30 17:22:38 -06:00
Cosimo Lupo
f15857cf3f
filterPen_test: add tests for decomposing filter pens 2024-03-05 15:58:42 +00:00
Cosimo Lupo
345d6b2f81 [instancer] drop explicit no-op axes from tuplevariations
Fixes #3453
2024-03-04 15:25:48 +00:00
Cosimo Lupo
f02813bd54
[cu2qu/ufo] return set of modified glyph names from fonts_to_quadratic
In ufo2ft preProcessor, we need to know which specific glyphs were actually modified (converted to quadratic), in order to do other things while processing filters, not simply if the fonts were modified as a whole; thus, here I changed fonts_to_quadratic to return the set of modified glyph names instead of just True/False. The change is backward compatible because code that checks whether the returned value is True/False will continue to work since bool(set) is True for non-empty set, False for empty ones.
2024-03-04 12:11:09 +00:00
Khaled Hosny
0f953cccd8 [otlLib] Support building MATH table 2024-02-14 02:48:13 +02:00
Behdad Esfahbod
4d3d8c5aba [designspace] Update test to exercise multiple <mappings> 2024-02-05 16:10:58 -07:00
Cosimo Lupo
96054e8152
[otlLib] choose most compact contextual lookup format (#3439)
* [otlLib] chose most compact contextual lookup format

Fixes https://github.com/fonttools/fonttools/issues/2934
2024-02-05 16:59:29 +00:00
Behdad Esfahbod
1e989abec4 [designspaceLib] Add "description" to <mappings> and <mapping>
Fixes https://github.com/fonttools/fonttools/issues/3435
2024-02-05 09:58:51 -07:00
Cosimo Lupo
6ff7d00e06
[feaLib] fix ordering of alternates in aalt lookups
Fixes https://github.com/fonttools/fonttools/issues/2937
2024-01-25 13:25:41 +00:00
Cosimo Lupo
796f677225
restore original spec5d1.fea example and modify expected ttx instead 2024-01-24 16:41:34 +00:00
Cosimo Lupo
957b5fb45a
don't sort product of liga components to keep declaration order
technically we are tweaking the original example from the spec but it keeps the spirit, so that the product of glyph classes produces the same representation in the font as if the sequences were manually enumerated (while keeping the declaration order)
2024-01-24 12:59:00 +00:00
Cosimo Lupo
f96b2128a1
[feaLib] keep declaration order of ligatures within ligature set
Fixes #3428
2024-01-24 12:59:00 +00:00
Jens Kutilek
7cdac78423
Add transformRoundFunc parameter to RoundingPens (#3426)
* Add optional transformRoundFunc to RoundingPen and RoundingPointPen
* Add tests
* Add doc about comparing UFO to TTF glyphs
* Use floatToFixedToFloat for example with rounding
2024-01-23 18:59:09 +01:00
Khaled Hosny
2616ab959c feaLib: Drop glyph and class names length limit
These were implemented to follow FEA spec, but makeotf does not seem to
have a name length limit any more (or it has a very large one, I tested
a 600-character name and it was accepted).

Fixes https://github.com/googlefonts/ufo2ft/issues/588
See also https://github.com/googlefonts/ufo2ft/pull/811#discussion_r1461667058
2024-01-22 16:38:54 +02:00
Cosimo Lupo
b8b1bc4341
path_test: fix parsing xml declaration
the latest lxml.etree.fromstring complains with syntax error when the xml declaration contain 'standalone' but does not contain encoding, apparently the xml declaration attributes have predefined order
2024-01-15 17:21:17 +00:00
خالد حسني (Khaled Hosny)
1c25210360
[featureVars] Re-use FeatureVariationRecord's when possible
If a FeatureVariationRecord with the same ConditionTable exists re-use
it and append FeatureTableSubstitutionRecord’s.

Without this, in the following feature code only the first lookup will
be applied since there will be two FeatureVariationRecord with the same
ConditionTable, so the first will be matched and the other will be
skipped:

    conditionset test {
        wght 600 1000;
        wdth 150 200;
    } test;

    variation ccmp test {
        sub e by a;
    } ccmp;

    variation rlig test {
        sub b by c;
    } rlig;

With this change only one FeatureVariationRecord will be created with
two FeatureTableSubstitutionRecord’s.
2024-01-10 19:06:26 +02:00
Behdad Esfahbod
36e2c6dcd3 [varLib.models] Simplify based on review 2023-12-12 04:39:05 -07:00
Behdad Esfahbod
5a5898c824 [varLib.models] Add interpolateFromMastersAndMasterScalars()
Faster than the alternative way to calculate them.
2023-12-10 17:15:42 -07:00
Cosimo Lupo
97d487638c
models_test: confirm value interpolated from master scalars is as expected
and rename test method to match its content
2023-12-08 11:41:59 +00:00
Behdad Esfahbod
0edb0072f3 [varLib.models] Port getMasterScalars tests from Just
https://github.com/fonttools/fonttools/pull/3380#issuecomment-1846051270
2023-12-07 13:43:40 -07:00
Behdad Esfahbod
85883f09bc [varLib.models] Add getMasterScalars 2023-12-07 12:29:00 -07:00
Behdad Esfahbod
4f6c739181 Move LerpGlyphSet and lerp_recordings to more prominent places
Fixes https://github.com/fonttools/fonttools/issues/3361
2023-12-07 04:49:59 -07:00
Behdad Esfahbod
8728789c05 [instancer] Don't produce triples outside <-1,0,+1>
Fixes https://github.com/fonttools/fonttools/issues/3350
2023-12-06 10:22:11 -05:00
Cosimo Lupo
e538b9c02f
[featureVars_test] test appending records for new features 2023-12-02 11:18:31 +00:00
Cosimo Lupo
82021732ae
[featureVars] expose method to addGSUBFeatureVariations to existing VF
Fixes https://github.com/fonttools/fonttools/issues/3357
2023-12-01 18:54:15 +00:00
Cosimo Lupo
a2e05fb084
[varLib_test] use multiple tags in FeatureVarsCustomTag.designspace 2023-12-01 16:53:32 +00:00
Simon Cozens
b5ddc99fb9
linelike intersections (#3353)
* Replace linelike intersections with line-curve/line-line tests, fixes #3352

* Tests for #3352
2023-11-27 17:27:28 +00:00
Behdad Esfahbod
51e70f9742
[interpolatable] Return master indices in addition to master names (#3346)
[interpolatable] Add master indices to problem reports

More solid than using names to refer back to the master index,
as needed in interpolatablePlot.
2023-11-20 08:59:11 -07:00
Behdad Esfahbod
c92f378691 [tests] Add test for symfont 2023-11-15 10:31:25 -07:00
Cosimo Lupo
64b2e5c968
Merge pull request #3337 from fonttools/instancer-sync-vmetrics
[instancer] Ensure hhea vertical metrics stay in sync with OS/2 after MVAR instancing
2023-11-15 15:02:10 +00:00
Cosimo Lupo
a92b2b0725
[instancer_test] check that vertical metrics stay in sync after MVAR instancing 2023-11-15 14:05:43 +00:00
Cosimo Lupo
f518e5a704
[OS/2] don't error getting/setting codepages if version=0
return empty set, or set the bits and bump the version to match
2023-11-15 12:21:02 +00:00
Cosimo Lupo
aaed718e41
[glyf_test] Test that composite referencing empty glyph also gets zero bounds
Add reproducer for possible regression in Glyph.recalcBounds introduced with https://github.com/fonttools/fonttools/pull/3301
2023-11-14 16:30:26 +00:00
Simon Cozens
4c60c5f3ba
Clone variable mark anchor before building (#3330)
* Copy mark anchor before OTifying

* Add test for variable mark anchor
2023-11-13 16:43:55 +00:00
Khaled Hosny
28735a6d0a [subset] Add --prune-codepage-ranges 2023-11-11 01:54:00 +02:00
Khaled Hosny
be8ec35934 [OS/2] Add recalcCodePageRanges
Ported from the ufo2ft code (which is port from FontForge code), with
some additional functions for parity with recalcUnicodeRanges.
2023-11-11 01:54:00 +02:00
Cosimo Lupo
53e71f9eb7
Merge pull request #3309 from fonttools/pyup-scheduled-update-2023-10-23
Scheduled weekly dependency update for week 43
2023-11-03 10:33:00 +00:00
Cosimo Lupo
335a1e56ec re-run black v23.10 on all .py files 2023-11-03 10:25:15 +00:00
Cosimo Lupo
74da89beeb
Merge pull request #3317 from fonttools/instantiate-avgcharwidth
Recalc avgcharwidth after instancing
2023-11-03 10:12:07 +00:00
Simon Cozens
71e991b87f Fixup expectations 2023-11-02 17:28:13 +00:00
Cosimo Lupo
9a46f9d3ab
Merge pull request #3324 from fonttools/otllib-sort-classes
[otlLib] make ClassDefBuilder class order match varLib.merger's
2023-11-02 16:47:06 +00:00
Cosimo Lupo
2c07619344 [otlLib] make ClassDefBuilder class order match varLib.mergers
see https://github.com/fonttools/fonttools/blob/c3d876/Lib/fontTools/misc/classifyTools.py#L77

i.e. we want (large classes first, then lexicographic order on the glyphs); previously otlLib was sorting by the _reverse_ of (small classes first, then glyphs lexicographic order) -- effectively comparing the reverse of the glyph sets of classes of the same size.

Fixes https://github.com/fonttools/fonttools/issues/3321

note the ttx dump of previously built fonts may change but there won't be any functional changes.
2023-11-02 16:36:48 +00:00
Behdad Esfahbod
ae69e9e8be
[instancer] Allow relaxed limits syntax (#3323)
* [instancer] Allow relaxed limits syntax

Fixes https://github.com/fonttools/fonttools/issues/3322

Co-authored-by: Cosimo Lupo <clupo@google.com>
2023-11-02 10:22:23 -06:00
Simon Cozens
49570c3599
[instancer] Check if an axis has values before requiring it to be found (#3319)
* Check if an axis has values before requiring it to be found

* Add test
2023-10-31 08:21:34 +00:00
Behdad Esfahbod
9e36b9465d [varStore] Micro-optimize storeDeltas()
Also speed up the test slightly by skipping rounding.
2023-10-23 15:18:11 -06:00