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
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
9c7ffef55e
[instancer] Run black
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
bce11dfc85
[instancer.solver] Improve diagram for a case
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
36bf633555
[instancer.solver] Format
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
b54ac734cc
[instancer.solver] Add assertion
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
aabced171e
[instancer.solver] Fix case3 with gain
...
Ouch!
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
7ee8414cab
[instancer.solver] Better handling of peak==axisDef
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
e08553011a
[instancer.solver] Handle when peak falls on new axis default
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
890938ef09
[instancer.solver] Try harder to fix on python 3.7
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
3c998785db
[instancer.solver] Use older lru_cache instead of cache
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
53b6c4c9fe
[instancer.solver] Fix negative -2 case
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
4dc271ac72
[instancer.solver] Remove redundant words
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
c628cc82b5
[instancer.solver] Rename internal function
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
6b6aba6bd4
[instancer.solver] Add ASCII-art
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
948788adaf
[instancer.solver] More API doc
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
7d15e33e69
[instancer.solver] Document API
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
52c791ad1d
[instancer.solver] Add a special case
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
245c3e9575
[instancer.solver] Comment algorithm
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
617f19ff8d
[instancer.solver] Add comments
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
7f79fad3d0
[instancer.solver] Remove unused _solveWithoutGain()
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
b6a3ef37e1
[instancer.solver] Second try at sending everything through WithGain
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
c3fa1b59ac
[instancer.solver] Return None as gain tent
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
dd5452527e
[instancer.solver] More fixes
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
4637daf191
[instancer.solver] Fix 3a
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
8a49fdc4ec
[instancer.solver] Fix up algorithm again
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
6210e7d331
[instancer.solver] Test more
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
17ac8d9f28
Revert "[instancer.solver] Remove _solveWithoutGain"
...
This reverts commit e867aadf6f6befdc84fd4cf1496faa2517e42b17.
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
2d986a37fc
[instancer.solver] Remove _solveWithoutGain
...
Use _solveWithGain for it. Fold all into a general _solve.
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
4d65c6c2a2
[instancer.solver] Cache results
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
f2ebccd468
[instancer.solver] Add tests
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
5a2836d97b
[instancer.solver] Fix tag
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
1ed0f8a655
[instancer.solver] Remove special-cases
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
7f149f2617
[instancer.solver] Fix up, also route pinned through general
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
16d7e335e4
[instancer.solver] Write out rest of general-case solver
...
Untested.
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
bf55b28c50
[instancer.solver] Implement no-gain in the general solution
...
This can replace the DefaultUnmoved
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
e94f564149
[instancer.solver] Start fleshing out L4
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
eef320e974
[instancer] Err, fixups
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
ac05ed19bb
[instancer] Fix code move
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
d611c1519e
[instancer] Add assertion
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
8ca0dab0c0
[instancer.solver] Simplify solver
2022-10-13 10:35:02 -06:00
Behdad Esfahbod
32be0d46ec
[instancer.solver] Massage a bit
2022-10-13 10:35:02 -06:00