Cosimo Lupo
ad7b97a7b2
[varLib.mutator] clamp width to 0 if left/right phantom points are swapped
...
https://github.com/fonttools/fonttools/pull/1198
2018-02-28 15:13:59 +00:00
Behdad Esfahbod
54fd71f73c
[varLib/subset] Fix subsetting of GPOS variation data
...
Was not picking up ValueRecord Device objects. Ouch!
2018-02-27 18:52:07 -08:00
Behdad Esfahbod
e299650f9f
[varStore] In OnlikeVarStoreBuilder, dedup items
...
While we optimize VarStore later, just deduping here reduces amount
of data we have to work with later by 8x in NotoSans-VF.ttf test
case. It's a cheap optimization, so do it.
2018-02-21 15:12:20 -08:00
Behdad Esfahbod
88343d2367
[varLib.mutator] Fix comment
2018-02-21 14:54:27 -08:00
Cosimo Lupo
767b9311eb
[varStore] don't import unicode_literals
...
Tests were failing on python 2.7.6 because array module doesn't accept
unicode strings (fixed in later 2.7.x releases).
An alternative fix would have been to cast array(str('h'), [...]) but
that seemed a bit too much, especially since varStore module doesn't
really do heavy text manipulation (there aren't other string literals).
We cannot use unicode_literals unconditionally, because of this and
similar issues in the stdlib. We should use it only when it makes sense
and reduces the frequency of u"".
2018-02-21 12:11:59 +00:00
Behdad Esfahbod
d46d40dc9e
[varLib] Actually remove duplicates while optimizing VarStore!
...
Ouch! Shrinks NotoSans-VF.ttf GDEF VarStore further down.
Original was 1016278 bytes. Before this change it was optimizing
to 256145 bytes. With this change, it goes down to a mere 57127
bytes!!!
2018-02-21 01:27:58 -08:00
Behdad Esfahbod
e910309952
[varLib] Optimize HVAR VarStore and indirection
2018-02-21 01:22:59 -08:00
Behdad Esfahbod
1adf7fd2c0
[varLib] Update tests for VarStore optimization
...
Also, don't emit GDEF if VarStore is empty.
2018-02-21 01:10:36 -08:00
Behdad Esfahbod
398f7169c8
[varLib] Optimize MVAR VarStore
2018-02-21 00:55:39 -08:00
Behdad Esfahbod
7aef5c8072
[varLib] Optimize GDEF VarStore when generating varfonts
...
Sweet...
2018-02-21 00:22:14 -08:00
Behdad Esfahbod
4e31921634
[varLib] Remove nonsensical code
...
GSUB has no positioning, so cannot have any Device tables with variations.
2018-02-21 00:19:54 -08:00
Behdad Esfahbod
3c4203d985
[varLib.varStore] Implement VarStore optimizer
...
On NotoSans-VF.ttf (a 5MB font), saves 15% total size by optimizing
GDEF VarStore and resulting GPOS shrinkage.
2018-02-21 00:18:55 -08:00
Behdad Esfahbod
073227bbb0
[varLib.varStore] Start implementing a VarStore optimizer
...
Commandline takes varfont and optimizes its GDEF VarStore.
2018-02-20 20:58:18 -08:00
Behdad Esfahbod
d5efd2b7ee
[varLib] When optimizing NumShorts, drop zero columns
...
Related to https://github.com/fonttools/fonttools/issues/1184
2018-02-20 20:51:56 -08:00
Behdad Esfahbod
323783d41c
[varLib] Allow excluding arbitrary tables
2018-02-19 19:16:35 -08:00
Behdad Esfahbod
ba52a32fed
[varStore] Refactor code around
2018-02-19 19:07:22 -08:00
Behdad Esfahbod
64834d079d
[varStore] Add subset_varidxes as method on VarStore
2018-02-19 18:57:09 -08:00
Behdad Esfahbod
ca7cd85731
[varLib] Add a couple of commandline options
2018-02-19 17:18:27 -08:00
Behdad Esfahbod
2ca6cc2dc3
[varLib] Handle overflow in OnlineVarStoreBuilder
2018-02-19 16:42:51 -08:00
Behdad Esfahbod
3cfc4a4be2
[subset] Move code around
2018-02-18 23:16:00 -08:00
Behdad Esfahbod
48125e9812
[varLib] Fix HVAR generation
...
We cannot tail-optimize there.
2018-02-18 22:58:47 -08:00
Behdad Esfahbod
f3def2ea5a
[subset] Fix pruning of GDEF VarStore
2018-02-18 22:37:44 -08:00
Behdad Esfahbod
21cbab8ce9
Fix read/write of VarIdxMap to use glyph names
...
Was relying on glyph IDs. Ouch.
2018-02-18 22:33:32 -08:00
Behdad Esfahbod
eb6af2da72
[varLib] Fix pruning of HVAR
2018-02-18 21:49:39 -08:00
Behdad Esfahbod
23d373caac
[varLib] Comment
2018-02-18 21:45:27 -08:00
Behdad Esfahbod
e0f2848ef5
[subset] Subset Regions when subsetting VarStore
...
Part of https://github.com/fonttools/fonttools/issues/1179
2018-02-18 19:45:57 -08:00
Behdad Esfahbod
67814fd3b3
[subset] Prune GDEF VarStore
...
Mostly fixes https://github.com/fonttools/fonttools/issues/1179
2018-02-18 19:20:00 -08:00
Denis Moyogo Jacquerye
846f1afa95
varLib: don’t fail if STAT already in font
2018-02-05 13:12:24 +00:00
Behdad Esfahbod
633f44da39
[varLib.merger] Fix merging of PairPos Format2 with missing subtables
2018-01-08 10:49:25 +00:00
Behdad Esfahbod
e58499cc06
[varLib.merger] Minor
2018-01-08 10:31:50 +00:00
Behdad Esfahbod
b624e0c08e
[varLib.merger] Handle missing PairPos format1/2 subtables in AligningMerger
...
Fixes https://github.com/fonttools/fonttools/issues/1125
The Format2 is still failing in my test case. Investigating.
2018-01-08 10:27:33 +00:00
Behdad Esfahbod
8af430997d
[varLib] Start generating STAT table
...
Right now just reflects the axes, and even that with certain limitations:
- AxisOrdering is set to the order axes are defined,
- Name-table entries are not shared with fvar.
Towards https://github.com/LettError/designSpaceDocument/issues/8
2017-11-13 21:25:04 -08:00
Behdad Esfahbod
22f3b466b4
[varLib] Add TODO
2017-11-13 21:01:27 -08:00
Behdad Esfahbod
645b7a8355
[varLib] Pass fvar axis order ot VariationModel()
...
Update expected test results.
2017-10-25 15:43:47 -06:00
Behdad Esfahbod
3fbc4688eb
[varLib.mutator] Drop GDEF is nothing left in it
...
Part of fixing https://github.com/fonttools/fonttools/pull/1079#issuecomment-338710803
2017-10-25 11:58:44 -04:00
Behdad Esfahbod
0b5a923ef8
[varLib.mutator] Fix mutating of ValueRecord objects
...
Part of fixing https://github.com/fonttools/fonttools/pull/1079#issuecomment-338710803
2017-10-25 11:58:32 -04:00
Behdad Esfahbod
69bbddea92
[varLib.mutator] Correctly unset Device entries that are None
...
Part of fixing https://github.com/fonttools/fonttools/pull/1079#issuecomment-338710803
2017-10-25 11:58:32 -04:00
Jens Kutilek
97a31eb34e
Missed a change in return values
2017-10-22 17:56:12 -04:00
Cosimo Lupo
4bd57b9844
[mvar] rename MVAR_entries -> MVAR_ENTRIES
...
I like all-uppercase for global constants
2017-10-22 12:19:24 +01:00
Cosimo Lupo
28bb992c1f
replace int(round(...)) with round(...)
...
We don't need to cast to int when using the round function from py23,
as this is a backport of python3's built-in round and thus it returns
an int when called with a single argument.
2017-10-22 12:03:52 +01:00
Behdad Esfahbod
5eb3cbe2b0
[varLib.mutator] Mutate GPOS
...
Cleans up GDEF varstore as well.
What's left:
- In none of the varLib.merger Mergers we handle the CaretValueFormat3. That should be done,
even though no one uses this,
- GPOS/GSUB FeatureVariations are not applied. Shouldn't be hard.
- 'rvrn' should be folded into 'ccmp' or some other default feature.
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
e05ece2715
[varLib.varStore] Cache scalars in VarStoreInstancer
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
7494943c1b
[varLib.varStore] Add VarStoreInstancer
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
8db7a65d39
[varLib.varStore] New module
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
117f8f0eb3
[varLib.mutator] Quantize normalized location to F2Dot14
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
1adacb34f0
[varLib.mutator] Apply avar
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
acd2f490af
[mutator] Implement MVAR
...
Test expectation needs updating. Leaving for someone else to confirm
the new value is correct and update the test.
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
cca7a79018
[varLib] Adjust for supportScalar() default ot=True change
...
Fixup for 028ed0125244531215d4d774474d929acda14d49
2017-10-19 10:07:08 -07:00
justvanrossum
2f6ec32ff0
oops, forgot to adapt doctests; thanks @anthrotype\!
2017-10-18 10:29:19 +02:00
justvanrossum
028ed01252
set default value of the ot argument to True, as discussed in a1629fa52b
2017-10-18 10:04:42 +02:00