Cosimo Lupo
5b93100616
also check endPtsOfContours in dropImpliedOnCurvePoints
...
as per review https://github.com/fonttools/fonttools/pull/3147#discussion_r1214708207
Also, don't do same work multiple times when dropping points from flags/endPtsOfContours arrays since these are supposed to be the same for all interpolatable glyphs
2023-06-05 12:11:17 +01: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
Cosimo Lupo
b6bb9dfef0
ttGlyphPen: only call dropImpliedOnCurvePoints for simple glyphs after fully formed
2023-06-02 13:53:00 +01:00
Cosimo Lupo
6a276d9f6a
dropImpliedOnCurvePoints: raise if incompatible, skip empty/composites
2023-06-02 13:51:28 +01:00
Cosimo Lupo
3b62811b63
have dropImpliedOnCurvePoints return the set of point indices useful for testing
2023-06-01 18:21:59 +01:00
Cosimo Lupo
e19871981d
add docstring to dropImpliedOnCurvePoints function
2023-06-01 16:49:30 +01:00
Cosimo Lupo
b7f4e9b83e
move dropImpliedOnCurvePoints function to glyf table module
...
so it can be used by client code on multiple glyf Glyph objects regardles of TTGlyphPen
2023-06-01 16:49:29 +01:00
Cosimo Lupo
a73abc6b87
make drop_implied_oncurves work with multiple interpolatable glyphs
2023-06-01 16:49:29 +01:00
Cosimo Lupo
3bbc19abb1
TTGlyphPen: do not error with empty contours, simply ignore them
...
Fixes https://github.com/googlefonts/fontmake/issues/1001
2023-05-31 11:58:14 +01:00
Cosimo Lupo
0bf84f9c7b
Merge pull request #3129 from fonttools/privData_bytes
...
privData needs to padded with bytes not str
2023-05-30 12:10:30 +01: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
David Corbett
b8dcb85161
[otlLib] Fix error message in MarkBasePosBuilder
2023-05-28 20:29:49 +02:00
Khaled Hosny
fd854d70d8
[feaLib] Simplify variable scalars that don’t vary
...
If a variable scalar does not vary (i.e. all values are the same), we
can simplify it and use a simple value instead. Arguably users shouldn’t
be using variable scalar in this case, but it helps when the feature
code is auto generated so each feaLib users doesn’t have to do the
check done here themselves.
2023-05-27 02:56:11 +03:00
Khaled Hosny
f8abda4570
[feaLib] Refactor-out builder code handling variable scalars
...
Refactor-out this piece of code to simplify the next commit.
2023-05-27 02:55:07 +03: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
Ben Kiel
d11a67010f
privData needs to pad with bytes not str
2023-05-25 10:30:28 -05: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
Behdad Esfahbod
93d87df315
[varStore] Refactor code into a method
2023-05-25 07:12:27 -06:00
Behdad Esfahbod
035529883c
[varStore] Minor rename a method
2023-05-25 07:06:48 -06:00
Behdad Esfahbod
c1ab8995f2
[varStore] Minor adjustment to the optimize() algorithm
...
It's very unlikely that this path is needed, but it's correct
to have it.
2023-05-25 07:00:28 -06:00
Behdad Esfahbod
5255c01bcc
Merge pull request #3126 from fonttools/varStore-quantize
...
Var store quantize
2023-05-25 14:26:47 +02:00
Behdad Esfahbod
a08f5ebbc9
[varStore] Update comment
2023-05-25 06:24:00 -06:00
Cosimo Lupo
98779958d0
Merge pull request #3100 from fonttools/explicit-closing-line-pen
...
add filter pen that explicitly emits closing line when lastPt != movePt
2023-05-25 12:56:48 +01:00
Behdad Esfahbod
ae7394e68a
[varLib.main] Accept --quantization
2023-05-24 18:10:08 -06:00
Behdad Esfahbod
d9649a7835
[varStore] Add test for quantization
2023-05-24 18:10:08 -06:00
Behdad Esfahbod
311bda2021
[varStore] Add optional quantization to optimize()
2023-05-24 18:10:08 -06:00
Behdad Esfahbod
47813b217c
[varStore] Make optimize() stable
...
Before, calling optimize() on its own output could generate different
result. I think it's stable now.
2023-05-24 18:09:58 -06:00
Behdad Esfahbod
6b20edf1fb
[varStore] Fix algorithm comment to match code
2023-05-24 17:08:20 -06:00
Behdad Esfahbod
1aa088e150
[varStore.main] Speed up if output is not requested
2023-05-24 17:05:00 -06:00
Behdad Esfahbod
2f78605c27
[varStore] Change a sort key in optimize()
...
Produces more optimized results in empirical testing.
2023-05-24 16:55:16 -06:00
Behdad Esfahbod
aeaf98a438
[varStore] Another fix and test
2023-05-24 16:34:15 -06:00
Behdad Esfahbod
8ae33a7ef3
[varStore] Add a round=round parameter to storeMasters
2023-05-24 14:24:36 -06:00
Behdad Esfahbod
22c76c45ff
Merge pull request #3124 from fonttools/varStore-optimize-fix
...
[varStore] Improve optimize algorithm
2023-05-24 21:40:47 +02:00
Behdad Esfahbod
b72a8da045
[varStore] Adjust encoding overhead in optimize()
...
Previously we were not accounting for the LOffset to VarData.
2023-05-24 13:21:33 -06:00
Behdad Esfahbod
0677c0e705
[varStore] Another bugfix in optimize()
2023-05-24 13:18:58 -06:00
Behdad Esfahbod
cb2f5aacd3
[varStore] More documentation
2023-05-24 12:19:46 -06:00
Behdad Esfahbod
cdcbf64d36
[varStore] Document the optimize algorithm
2023-05-24 12:09:43 -06:00
Behdad Esfahbod
58954179ec
[varStore] Another fix to the optimize algorithm
...
Previously we were disregarding the best_gain. Ouch!
2023-05-24 12:02:05 -06:00