1307 Commits

Author SHA1 Message Date
Behdad Esfahbod
2253722dfb [varLib.avarPlanner] Increase target widths 2023-07-22 22:32:10 -06:00
Behdad Esfahbod
a9fbeda24b [varLib.avarPlanner] Add library support for glyph frequencies
No cmdline support yet.
2023-07-22 22:04:18 -06:00
Behdad Esfahbod
7d05b896e6 [varLib.avarPlanner] Better blackness calculation
Consider glyph width.
2023-07-22 22:01:03 -06:00
Behdad Esfahbod
8557e535eb [varLib] Add avarPlanner 2023-07-22 21:59:01 -06:00
Behdad Esfahbod
b0cf3e1ebe [instancer] Allow null ConditionSet
Fixes https://github.com/fonttools/fonttools/issues/3211
2023-07-19 19:55:42 -06:00
Behdad Esfahbod
b14a29c353 [varLib.merger] Support sparse CursivePos
Part of https://github.com/fonttools/fonttools/issues/3168
2023-07-18 07:14:25 -06:00
Behdad Esfahbod
fb56e7b7c9
Merge pull request #3179 from fonttools/L4-fixes
L4 fixes
2023-07-11 10:47:59 -04:00
Behdad Esfahbod
0893ba93f8 [instancer/L4] Address review comments 2023-07-11 08:46:46 -06:00
Behdad Esfahbod
46086cdb66 [interpolatable] Add --glyphs 2023-06-27 16:59:05 -06:00
Behdad Esfahbod
71cca00b05 [instancer/L4] Remove an unreachable code path and better comment 2023-06-21 19:01:27 -06:00
Behdad Esfahbod
ddc484d384 [instancer/L4] Add a comment 2023-06-21 18:30:19 -06:00
Behdad Esfahbod
10bc7a804a [instancer/L4] Implement an optimization 2023-06-21 17:52:12 -06:00
Behdad Esfahbod
204532aee3 [instancer/L4] Misc fixes and fix tests 2023-06-21 15:09:56 -06:00
Behdad Esfahbod
43e5aae018 [instancer/L4] Fix avar mapping as well 2023-06-21 15:09:56 -06:00
Behdad Esfahbod
72b6102949 [instancer/L4] Fix normalizeValue for L4 solver
Imagine a font with current min/default/max of 100,700,1000. And new
setting of 100,400,1000. The current normalizeLocation will calculate
the new location for 700 to be +.33, whereas it should calculate +.5!
This is because 400 translates to -.5, so 700 will be normalized to
-1,-.5,+1 and get +.33...

We need a special normalizeLocation that is aware of the "distance"
between min/default/max, ie. the non-normalized values. Then it will be
clear that the distance from 400 to 700 is equal to 700 to 1000, and as
such 700 should be normalized to .5, not .33... I'm still trying to
figure out the case where avar is present.

Store this distance in NormalizeAxisLimit and reach it out in the
solver.

Fixes https://github.com/fonttools/fonttools/issues/3177
2023-06-21 15:09:56 -06:00
Behdad Esfahbod
94e081611c [instancer/L4] Further simplify
outGain is always zero in this branch.
2023-06-21 15:09:56 -06:00
Behdad Esfahbod
7385cbbc34 [instancer/L4] Simplify 2023-06-21 15:09:56 -06:00
Behdad Esfahbod
023ad3a363 [instancer/L4] Fix crossing calculation 2023-06-21 15:09:56 -06:00
Cosimo Lupo
b3ce0979cb
Merge pull request #3123 from fonttools/avar2-designspace
[designspace] Add avar2 mapping support
2023-06-08 12:58:51 +01:00
Behdad Esfahbod
d601646cf2 [varLib/avar2] Remove warning
https://github.com/fonttools/fonttools/pull/3123#issuecomment-1573199305
2023-06-02 12:51:25 -06:00
Cosimo Lupo
0690703b86
varLib: add --drop-implied-oncurves option
For the test, I used the Tests/varLib/data/Build.designspace as starting point, modified the 'a' glyph so that 1 on-curve point (the first one) becomes impliable for all the masters.
2023-06-02 15:50:32 +01:00
Behdad Esfahbod
ddf16c9130 [designspaceLib/avar2] Apply review comments 2023-06-01 11:54:43 -06:00
Behdad Esfahbod
ce0a32d1a4 [varLib.builder] Fixup 2023-05-30 22:46:47 -06:00
Behdad Esfahbod
a99a75e8a6 [varLib/avar2] Use buildDeltaSetIndexMap()
Also change buildDeltaSetIndexMap() to move the identity
optimization there. Update the only other callsite (COLRv2).
2023-05-30 13:30:36 -06:00
Behdad Esfahbod
a08acf41f8 [varLib/avar2] Omit identity VarIdx map 2023-05-30 13:22:12 -06:00
Behdad Esfahbod
d915f08e76 [varLib/avar2] Don't require base master to be specified explicitly
We can deduce it as empty mapping.
2023-05-30 13:13:49 -06:00
Behdad Esfahbod
ff7f49a94c [varLib/avar2] Add compile test 2023-05-30 13:13:49 -06:00
Behdad Esfahbod
246d539e29 [designspaceLib/avar2] Warn if input location missing for an output axis
https://github.com/fonttools/fonttools/pull/3123#issuecomment-1568852694
2023-05-30 12:10:15 -06:00
Behdad Esfahbod
588cbc982d [designspaceLib/avar2] Rename variables 2023-05-30 11:55:48 -06:00
Behdad Esfahbod
3ba7e6d706 [instancer-solver] Fix a bug
Fixes https://github.com/fonttools/fonttools/issues/3139
2023-05-29 17:39:02 -06:00
Behdad Esfahbod
ae2305196a [designspaceLib/avar2] Store axis name, not tag, in <dimension> 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
0b57567c14 [designspaceLib/avar2] Add AxisMappingDescriptor 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
be9dacad74 [designspaceLib/avar2] Rename mapping to axisMappings 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
5785fdeec3 [avar2] Emit the difference of input vs output 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
b9e03b165b [avar2] Rewrite loop 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
50fc8218b3 [designspace/varLib] Hack to read avar2 mapping and build avar2 table
This just uses list of list of dictionaries. Should use proper objects.

https://github.com/fonttools/fonttools/issues/3049

https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2-in-designspace.md
2023-05-28 15:14:25 -06:00
Behdad Esfahbod
59058bb54f [varStore.optimize] Address review comment
Harmless thinko.
2023-05-25 12:24:46 -06:00
Behdad Esfahbod
4e7cdeb8b1 [varStore.optimize] More idiomatic 2023-05-25 11:35:50 -06:00
Behdad Esfahbod
0a239f15d8 [varStore.optimize] Comment 2023-05-25 11:33:08 -06:00
Behdad Esfahbod
f5e62a1375 [varLib.optimize] Minor more idiomatic 2023-05-25 10:54:13 -06:00
Behdad Esfahbod
dbc91b1b5b [varStore.optimize] Remove unused variable 2023-05-25 08:52:13 -06:00
Behdad Esfahbod
12aba9070f [varStore.optimize] Combine a couple of loops 2023-05-25 08:50:01 -06:00
Behdad Esfahbod
b0a0f74492 [varStore.optimize] Speed up some more 2023-05-25 08:47:47 -06:00
Behdad Esfahbod
b6ebb4c411 [varStore.optimize] Further speedup 2023-05-25 08:45:53 -06:00
Behdad Esfahbod
d8fabfa362 [varStore.optimize] Remove unused method 2023-05-25 08:28:12 -06:00
Behdad Esfahbod
832f2f766f [varStore.optimize] Use faster intTools.bit_count as popcount 2023-05-25 08:19:15 -06:00
Behdad Esfahbod
9cbde09cdc [varStore.optimize] Speed up 2023-05-25 08:09:27 -06:00
Behdad Esfahbod
f12f3d863c [varStore.optimize] Remove unused best_new_encoding 2023-05-25 07:56:33 -06:00
Behdad Esfahbod
da305615d0 [varStore.optimize] Simplify algorithm
Produces better results even.
2023-05-25 07:49:13 -06:00
Behdad Esfahbod
47ec18f788 [varStore] Better optimize() algorithm
See comments.

Produces better results.
2023-05-25 07:39:41 -06:00