Behdad Esfahbod
0a7433f847
[cffLib] Add CFF<->CFF2 convertors that work on otFont
2024-05-16 16:29:22 -07:00
Behdad Esfahbod
39ec4e6c0c
[cffLib] Add CFFToCFF2 and CFF2ToCFF cmdline and module
...
The CFF2ToCFF module is rather solid, at least IMO.
This takes convertCFFToCFF2 from cffLib. Apparently there's a more
complete one in varLib.cff:
https://github.com/fonttools/fonttools/issues/1835
Should merge the two and finish them.
2024-05-16 10:47:24 -07:00
Behdad Esfahbod
60e30fe008
[cffLib] Add a simple (and quite possibly incomplete) convertCFF2ToCFF()
2024-05-15 17:33:00 -07:00
Behdad Esfahbod
c06e8ba1e8
[instancer/CFF2] Comment
2024-05-14 18:26:35 -06:00
Behdad Esfahbod
3d2df43a67
[instancer/CFF2] Comment
2024-05-14 17:13:21 -06:00
Behdad Esfahbod
b3dc48a967
[instancer/CFF2] Micro-optimize commands
2024-05-14 13:39:09 -06:00
Behdad Esfahbod
1011d7e996
[instancer/CFF2] Add another test
2024-05-14 13:34:20 -06:00
Behdad Esfahbod
6d915fc816
[instancer/CFF2] Add test
2024-05-14 12:28:00 -06:00
Behdad Esfahbod
1891a7220d
[instancer/CFF2] Fixups
2024-05-14 11:11:39 -06:00
Behdad Esfahbod
385c2cb979
[instancer/CFF2] Instantiate private-dict values
2024-05-14 11:11:25 -06:00
Behdad Esfahbod
bdd42f14fc
[instancer/CFF2] Fixups with used-vsindex handing
...
vsindex 0 is implied.
Also, add Unimplemented code for private-dict variable
values. I couldn't find any fonts using them, so for
now they remain unimplemented.
2024-05-14 01:15:04 -06:00
Behdad Esfahbod
68f87dd850
[instancer/CFF2] Fix tests
...
gvar is removed by the time we get to hmtx/vmtx subsetting.
2024-05-14 00:47:39 -06:00
Behdad Esfahbod
21fb882e67
[instancer/CFF2] Prune ununsed data
2024-05-14 00:35:09 -06:00
Behdad Esfahbod
6f85ebb02c
[instancer/CFF2] Full-instancing
2024-05-14 00:11:29 -06:00
Behdad Esfahbod
ae18197f6f
[instancer/CFF2] Instantiate hmtx/vmtx
2024-05-14 00:11:29 -06:00
Behdad Esfahbod
c9ed0d1348
[instancer/CFF2] Minor sanity check
2024-05-14 00:11:29 -06:00
Behdad Esfahbod
f6c72eabf9
[instancer/CFF2] Add specialize and generalize arguments
2024-05-14 00:11:29 -06:00
Behdad Esfahbod
bb9a23702b
[instancer] Instantiate CFF2!
2024-05-14 00:11:29 -06:00
Behdad Esfahbod
969d09dcaf
[instancer] Fix name decision-making
...
All limits are tuple these days.
2024-05-14 00:10:50 -06:00
Behdad Esfahbod
e724acd41e
[instancer] Raise NotImplementedError if avar2 VarStore present
2024-04-15 08:21:14 -06:00
Cosimo Lupo
345d6b2f81
[instancer] drop explicit no-op axes from tuplevariations
...
Fixes #3453
2024-03-04 15:25:48 +00:00
Khaled Hosny
cf08265cd5
Black
2024-02-06 15:47:35 +02:00
Qunxin Liu
3e548ff29c
fix bug in instancer iup optimization
...
pass in correct value to tolerance
2024-01-25 16:18:24 -08:00
Just van Rossum
4826f9b016
Fix help string for AXIS=LOC
2023-12-11 15:59:30 +01: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
69636098bd
[instancer] Ensure hhea vertical metrics stay in sync with OS/2 ones after instancing
...
Fixes https://github.com/fonttools/fonttools/issues/3297
2023-11-15 14:05:44 +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
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
Behdad Esfahbod
2d9b80acd1
[instancer] Remove unused import
2023-11-01 15:11:56 -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
Simon Cozens
3573cd906b
Recalc avgcharwidth after instancing
2023-10-30 10:11:31 +00:00
Behdad Esfahbod
f1e56cd757
[instancer.solver] Fix case where axisDef < lower and upper < axisMax
...
Fixes https://github.com/fonttools/fonttools/issues/3291
2023-10-16 13:46:39 -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
0893ba93f8
[instancer/L4] Address review comments
2023-07-11 08:46:46 -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
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
33a94d820d
[instancer/VarComposite] Allow instancing non-variable VarComposite axes
2023-01-30 11:26:20 -07:00
Behdad Esfahbod
e4c25d02e6
[instancer/VarComposite] Raise NotImplementedError when warranted
2023-01-30 11:26:20 -07:00
Behdad Esfahbod
0d24114ad0
[varLib/VarComposite] Plug in in a couple places
2023-01-30 11:26:20 -07:00
Behdad Esfahbod
7899dd8dbc
[instancer] Limit axis ranges to that of fvar
...
Fixes https://github.com/fonttools/fonttools/issues/2959
2023-01-26 11:47:25 -07:00
Nikolaus Waxweiler
d584daa8fd
Blacken code
2022-12-13 11:26:36 +00:00
Cosimo Lupo
dbc3b48879
[instancer] udpdate OS/2 class and post.italicAngle when default moved (L4)
...
Previously we were only updating these when pinning wght/wdth/slnt axes.
Now we do whenever any of these axes defaults are changed, whether or not the axes are pinned or kept
Fixes https://github.com/fonttools/fonttools/issues/2885
2022-11-09 16:33:23 +00:00