Cosimo Lupo
6b6c34ab1a
otTables: fix IndexError while pruning of HVAR pre-write
2018-04-03 10:28:27 +01:00
Behdad Esfahbod
a523a69716
[varLib.models] Improve model
...
When adding a master and computing its support, when hitting another master,
we don't need to limit our box in every direction; we just need to limit in
one so we don't hit the older master with our support. Implement heuristic
that takes the first axis that minimizes the area loss.
This is not perfect, but a good improvement.
Before:
$ fonttools varLib.models 0,0 0,1 1,0 1,1 .4,0 .6,1 .5,.5 .7,.9Sorted locations:
[{},
{'A': 0.4},
{'A': 1.0},
{'B': 1.0},
{'A': 1.0, 'B': 1.0},
{'A': 0.6, 'B': 1.0},
{'A': 0.5, 'B': 0.5},
{'A': 0.7, 'B': 0.9}]
Supports:
[{},
{'A': (0, 0.4, 1.0)},
{'A': (0.4, 1.0, 1.0)},
{'B': (0, 1.0, 1.0)},
{'A': (0, 1.0, 1.0), 'B': (0, 1.0, 1.0)},
{'A': (0, 0.6, 1.0), 'B': (0, 1.0, 1.0)},
{'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
{'A': (0.5, 0.7, 1.0), 'B': (0.5, 0.9, 1.0)}]
After:
$ fonttools varLib.models 0,0 0,1 1,0 1,1 .4,0 .6,1 .5,.5 .7,.9
Sorted locations:
[{},
{'A': 0.4},
{'A': 1.0},
{'B': 1.0},
{'A': 1.0, 'B': 1.0},
{'A': 0.6, 'B': 1.0},
{'A': 0.5, 'B': 0.5},
{'A': 0.7, 'B': 0.9}]
Supports:
[{},
{'A': (0, 0.4, 1.0)},
{'A': (0.4, 1.0, 1.0)},
{'B': (0, 1.0, 1.0)},
{'A': (0, 1.0, 1.0), 'B': (0, 1.0, 1.0)},
{'A': (0, 0.6, 1.0), 'B': (0, 1.0, 1.0)},
{'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
{'A': (0, 0.7, 1.0), 'B': (0.5, 0.9, 1.0)}]
(Note the last line.)
2018-03-28 02:11:49 -07:00
Behdad Esfahbod
28000a4195
[varLib.plot] Display master names
2018-03-28 01:57:59 -07:00
Behdad Esfahbod
34458fe347
[varLib.plot] Label axes
2018-03-28 01:44:27 -07:00
Behdad Esfahbod
0359daad3d
Revert "[varLib.models] Improve modeling"
...
This reverts commit e4d363cc5c14471b02a98657e9bc04b75109c687.
2018-03-28 01:38:10 -07:00
Behdad Esfahbod
7504bde11b
[varLib.plot] Take input like varLib.models does
...
Eg.:
$ fonttools varLib.plot 0,0 0,1 1,0 1,1 .4,0 .6,1 .5,.5 .7,.7 .6,.9 .9,.6
2018-03-28 01:35:18 -07:00
Behdad Esfahbod
049020d52c
[varLib.plot] Draw a subplot for each master
...
Looks much nicer now.
2018-03-28 01:24:52 -07:00
Behdad Esfahbod
e4d363cc5c
[varLib.models] Improve modeling
...
After:
jj
2018-03-28 01:17:54 -07:00
Cosimo Lupo
2ef60fa989
varLib.mutator: add -o option, use argparse
2018-03-27 14:06:37 +01:00
Behdad Esfahbod
1bf955fb08
Err, forgot to link issue to previous commit
...
https://github.com/googlei18n/fontmake/issues/264
2018-03-26 20:46:26 -07:00
Behdad Esfahbod
42bef176a3
[varLib] Tweak support-resolution algorithm
...
Improve varLib model algorithm.
This, basically means any varfont built that had an unusual master
configuration will change when rebuilt.
Here's a good test: a two-axis with 8 masters at unusual locations:
2-----------------5----------3
| |
| 7 |
| |
| 6 |
| |
| |
| |
0-----------4----------------1
Previously, the reach of master 3 (Black Extended) would
have started from A=.4, ie, the A position of master 4.
It now correctly starts from 0. Same thing with masters
after it. Ie, master 5 gets a span on the A axis from
0 to 1, whereas before it was getting from .4 to 1.
Previously, the on-axis masters always cut the space. They
don't anymore. That's more consistent, and fixes the main
issue Erik showed at TYPO Labs 2017. Same issue was also
causing the reach of master 3 to be limited, which I think
is the issue being discussed in the linked issue. Both should
be fixed.
It's hard to describe exactly what happened before / after.
Best to read the actual support values:
Before:
Sorted locations:
$ ./fonttools varLib.models 0,0 0,1 1,0 1,1 .4,0 .6,1 .5,.5 .7,.7
[{},
{'A': 0.4},
{'A': 1.0},
{'B': 1.0},
{'A': 1.0, 'B': 1.0},
{'A': 0.6, 'B': 1.0},
{'A': 0.5, 'B': 0.5},
{'A': 0.7, 'B': 0.7}]
Supports:
[{},
{'A': (0.0, 0.4, 1.0)},
{'A': (0.4, 1.0, 1.0)},
{'B': (0.0, 1.0, 1.0)},
{'A': (0.4, 1.0, 1.0), 'B': (0.0, 1.0, 1.0)},
{'A': (0.4, 0.6, 1.0), 'B': (0.0, 1.0, 1.0)},
{'A': (0.4, 0.5, 1.0), 'B': (0.0, 0.5, 1.0)},
{'A': (0.5, 0.7, 1.0), 'B': (0.5, 0.7, 1.0)}]
After:
$ ./fonttools varLib.models 0,0 0,1 1,0 1,1 .4,0 .6,1 .5,.5 .7,.7
Sorted locations:
[{},
{'A': 0.4},
{'A': 1.0},
{'B': 1.0},
{'A': 1.0, 'B': 1.0},
{'A': 0.6, 'B': 1.0},
{'A': 0.5, 'B': 0.5},
{'A': 0.7, 'B': 0.7}]
Supports:
[{},
{'A': (0, 0.4, 1.0)},
{'A': (0.4, 1.0, 1.0)},
{'B': (0, 1.0, 1.0)},
{'A': (0, 1.0, 1.0), 'B': (0, 1.0, 1.0)},
{'A': (0, 0.6, 1.0), 'B': (0, 1.0, 1.0)},
{'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
{'A': (0.5, 0.7, 1.0), 'B': (0.5, 0.7, 1.0)}]
TODO: We should add this as a test case.
There's another improvement I want to make, but that's separate.
2018-03-26 20:32:27 -07:00
Behdad Esfahbod
05e2ec4d3a
[varLib.models] Add main()
...
Takes positions and prints model results:
$ ./fonttools varLib.models 0,0 0,1 1,0 1,1 .4,0 .6,1 .5,.5
Sorted locations:
[{},
{'A': 0.4},
{'A': 1.0},
{'B': 1.0},
{'A': 1.0, 'B': 1.0},
{'A': 0.6, 'B': 1.0},
{'A': 0.5, 'B': 0.5}]
Supports:
[{},
{'A': (0.0, 0.4, 1.0)},
{'A': (0.4, 1.0, 1.0)},
{'B': (0.0, 1.0, 1.0)},
{'A': (0.4, 1.0, 1.0), 'B': (0.0, 1.0, 1.0)},
{'A': (0.4, 0.6, 1.0), 'B': (0.0, 1.0, 1.0)},
{'A': (0.4, 0.5, 1.0), 'B': (0.0, 0.5, 1.0)}]
2018-03-26 20:10:15 -07:00
Behdad Esfahbod
2349ff37fd
[fontTools.varLib.plot] New module to plot a designspace's VariationModel
...
The visualization is not as useful as I was hoping would be :(.
2018-03-26 18:42:23 -07:00
Cosimo Lupo
a952c12156
Bump version: 3.24.2 → 3.24.3.dev0
2018-03-26 23:05:15 +01:00
Cosimo Lupo
3ae981c42a
Release 3.24.2
2018-03-26 23:05:15 +01:00
Cosimo Lupo
814565ffc7
Update changelog
...
[ci skip]
2018-03-26 23:05:08 +01:00
Behdad Esfahbod
d3a6a4e9e4
Don't fail during ValueRecord copy if src has more items
...
We drop hinting by simply changing ValueFormat, without cleaning
up the actual ValueRecords. This was causing failure at this assert
if font was subsetted without hinting and then passed to mutator.
2018-03-26 12:54:57 -07:00
Cosimo Lupo
3dbb7f763f
[merge] LookupList may be None
2018-03-26 15:32:13 +01:00
Cosimo Lupo
88f495dd68
feaLib.parser: use set for predefined ssXX and cvXX tags
...
it turns out regex would be slower in this case
See comments:
7cefeadb3a (r28011318)
2018-03-15 13:07:53 +00:00
Cosimo Lupo
1f99bb6d86
Bump version: 3.24.1 → 3.24.2.dev0
2018-03-06 19:39:38 +01:00
Cosimo Lupo
d604584bb3
Release 3.24.1
2018-03-06 19:39:38 +01:00
Cosimo Lupo
03e4c3675c
Update changelog
...
[skip ci]
2018-03-06 19:39:29 +01:00
Behdad Esfahbod
03b9c50055
[varLib] Don't remap same DeviceTable twice
...
The variation merger reuses matrix rows / entries when aligning kerning
matrices. Don't remap same DeviceTable twice. Alternative fix would
have been to not reuse objects but that slows things down.
Fixes https://github.com/fonttools/fonttools/issues/1206
2018-03-06 17:59:27 +01:00
Cosimo Lupo
168c7e1cd3
[varLib] rename --disableIUP to --disable-iup
2018-03-06 12:46:27 +01:00
Cosimo Lupo
81b5255bdc
Merge pull request #1208 from robmck-ms/master
...
Add flag to disable IUP optimization
2018-03-06 11:44:44 +00:00
Cosimo Lupo
e02055e070
[sfnt] TTCTag is a str
...
https://github.com/fonttools/fonttools/issues/1207
2018-03-06 10:46:01 +01:00
Rob McKaughan
4b44d97920
Add flag to disable IUP optimization
2018-03-05 15:32:17 -08:00
Cosimo Lupo
1d1acbb651
Bump version: 3.24.0 → 3.24.1.dev0
2018-03-01 21:10:30 +00:00
Cosimo Lupo
32fa73e356
Release 3.24.0
2018-03-01 21:07:16 +00:00
Cosimo Lupo
6338ba780f
Merge pull request #1205 from anthrotype/fix-1200
...
Fixups on top of PR #1204
2018-03-01 21:05:49 +00:00
Cosimo Lupo
1fbda037fb
Update changelog
...
[skip ci]
2018-03-01 20:54:30 +00:00
Cosimo Lupo
f0b73e3f0d
[lexer_test] fix macOS CI failues when tmpdir is a symlink
...
https://travis-ci.org/fonttools/fonttools/jobs/347725568#L364
2018-03-01 20:50:42 +00:00
Cosimo Lupo
d2ee826680
[ttGlyphPen] explain 'handleOverflowingTransforms' option in docstring
...
[skip ci]
2018-03-01 20:34:47 +00:00
Cosimo Lupo
4173315f09
[ttGlyphPen] rename option to 'handleOverflowingTransforms'
2018-03-01 20:17:48 +00:00
Cosimo Lupo
6ce8eec89c
[ttGlyphPen_test] add test for decomposeOverflowingTransform=False
2018-03-01 20:10:32 +00:00
Cosimo Lupo
56be13915b
[ttGlyphPen] minor
2018-03-01 20:03:45 +00:00
Cosimo Lupo
08c663f798
[ttGlyphPen_test] remove OverflowError test
2018-03-01 19:59:49 +00:00
Cosimo Lupo
aabc894d19
[ttGlyphPen] don't clamp to almost2 if asked to not decompose
...
In that case, let the struct.error do its job, no need to raise OverflowError ourselves here
2018-03-01 19:59:25 +00:00
Cosimo Lupo
4771e7cd6c
[ttGlyphPen_test] add test for OverflowError
2018-03-01 19:41:40 +00:00
Cosimo Lupo
acb1ebc793
[ttGlyphPen] add 'decomposeOverflowingTransform' option
...
if it's false and any transform value overflows, we raise an error instead of decomposing
2018-03-01 19:39:00 +00:00
Cosimo Lupo
4377185e29
[ttGlyphPen] further simplify
2018-03-01 19:15:36 +00:00
Cosimo Lupo
ede35d72c8
[ttGlyphPen_test] test decomposed contours keep original order
2018-03-01 18:52:55 +00:00
Cosimo Lupo
6606bbef3c
[ttGlyphPen] simplify
2018-03-01 18:50:45 +00:00
Cosimo Lupo
778d4933da
[ttGlyphPen_test] check ambiguous out-of-range case
...
that has both a value that exceeds the bounds, and one that's almost 2;
the former case should take precedence and the componed be decomposed
2018-03-01 18:01:01 +00:00
Cosimo Lupo
6a4ccd0e9f
[ttGlyphPen] check for out-of-range values before clamping
2018-03-01 18:00:41 +00:00
Denis Moyogo Jacquerye
85e363c216
Add TTGlyphPen test for scale limits
2018-03-01 17:48:49 +00:00
Denis Moyogo Jacquerye
098d9ecf6f
TTGlyphPen: handle scale limit
...
* decompose components with scale out of range [-2, 2)
* use closest F2Dot14 value when 0b1.11111111111111 < scale <= 2
2018-03-01 17:48:48 +00:00
Cosimo Lupo
c9308d2abc
NEWS.rst: minor markup
...
[skip ci]
2018-03-01 12:41:44 +00:00
Cosimo Lupo
927c181e4b
Update changelog
...
[skip ci]
2018-03-01 12:39:41 +00:00
Cosimo Lupo
1d020617d4
Merge pull request #1202 from fonttools/split-glyphs
...
[ttx] add option to dump glyf table's glyphs as individual ttx
2018-03-01 12:16:45 +00:00