Behdad Esfahbod
489c80c83b
[varLib.models] Add VariationModel.getScalars()
...
To factor out scalar computation out of each interpolation.
2017-05-23 00:54:11 -07:00
Behdad Esfahbod
adc4fe960e
[varLib.models] Remove unused line
2017-05-23 00:54:11 -07:00
Behdad Esfahbod
fdbe93e33c
[varLib.models] Minor; move computing scalars out of inner loop
2017-05-23 00:54:11 -07:00
Behdad Esfahbod
49df768cd3
[varLib.models] Minor
2017-05-23 00:31:48 -07:00
Behdad Esfahbod
a08fb27f17
[varLib.models] Minor
2017-05-23 00:26:53 -07:00
Behdad Esfahbod
0ed2df3f22
[varLib.interpolate_layout] Import designspace-loading logic from varLib
...
When varLib was updated for avar table, this was not. Share code such
that they don't get out of sync again. All of this to be made into
proper API some time...
2017-05-22 19:40:20 -07:00
Behdad Esfahbod
245d457fe6
[varLib.interpolate_layout] Change finder to master_finder
...
To be in line with varLib.build().
2017-05-22 18:46:41 -07:00
Behdad Esfahbod
81498e5baf
[varLib] Fix bug with recombining PairPosClass2 subtables that don't
...
Ouch. I have no idea why I made two separate if's to begin with, but the
continue should have also been aligned with the inner block...
Fixes root cause of https://github.com/fonttools/fonttools/issues/914
but now we hit an unimplemented feature there...
2017-05-20 23:03:25 -07:00
Behdad Esfahbod
997c073e26
[varLib.mutator] Implement IUP
2017-05-20 22:13:51 -07:00
Behdad Esfahbod
10ff112e6a
[varLib.mutator] Inching towards implementing IUP
2017-05-20 21:08:11 -07:00
Behdad Esfahbod
bfb4a2c648
[varLib] Pass down tolerance to IUP routines
2017-05-18 16:29:02 -07:00
Behdad Esfahbod
74f6715f27
[varLib] Minor speedup
2017-05-18 16:08:36 -07:00
Behdad Esfahbod
3db5be2195
[gvar] Remove GlyphCoordinates.__abs__()
...
It's not wel-defined, as abs typically is supposed to return a scalar...
Also combine the tolerance-check with the zero-check in varLib.
2017-05-18 16:06:10 -07:00
Behdad Esfahbod
e46f94950c
Change GlyphCoordinates.__bool__() semantics...
...
...to match those of other iterables.
I confused myself once already by having "if not delta" where delta was a list,
not GlyphCoordinates...
2017-05-18 16:06:10 -07:00
Behdad Esfahbod
e8571ee5e0
[varLib] Only use sparse points (ala IUP encoding) if cheaper
...
For now, this makes us encode one point per contour if feasible.
2017-05-18 16:06:10 -07:00
Behdad Esfahbod
f8c970568c
[varLib] Fix assert condition in _optimize_delta for empty contours
2017-05-18 16:06:10 -07:00
Behdad Esfahbod
52e2e2f930
[varLib] make _optimize_contour work with lists
2017-05-18 16:06:10 -07:00
Behdad Esfahbod
11227eb481
[varLib] Fix assert message
2017-05-18 16:06:10 -07:00
Behdad Esfahbod
a5b1285223
[varLib] Start IUP-optimization code
2017-05-18 16:06:10 -07:00
Jens Kutilek
d1cf59d2c9
Use a namedtuple for maxp values
2017-05-04 12:28:02 +02:00
Jens Kutilek
0eb3bb9d25
Use lambda expression for sorting as per @anthrotype’s suggestion
2017-05-04 12:08:04 +02:00
Jens Kutilek
539ef3786a
Sort glyphs by component depth before processing ( #945 )
2017-05-03 19:13:49 +02:00
Behdad Esfahbod
1b5e1c4b06
[varLib.merger] Fix _ClassDef_invert() to limit classes to allGlyphs
...
Fixes https://github.com/fonttools/fonttools/issues/939
We should rename this function and expose it publicly somewhere.
2017-04-27 16:41:22 -07:00
Behdad Esfahbod
656478fc6d
[varLib] Add notes re encoding multilingual names
2017-04-19 11:10:00 -07:00
Behdad Esfahbod
932b938d7d
[varLib] Minor
2017-04-12 21:56:49 -07:00
Behdad Esfahbod
968c25dd7f
[varLib] Generate avar table
...
Fixes https://github.com/fonttools/fonttools/issues/916
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
191cea5965
[varLib] Fixup for 91f4fd90d4fdee293052d9d226a31baa2e7edda8
...
Oops! Too many Axis classes.
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
0fa41c14b9
[varLib] Check all master and instance locations are valid
...
Ie. they don't specify any unknown axes, and location is within
axis minimum/maximum. We also allow master / instance locations
to not specify some axes, and we fill in the axis default for those.
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
9034f4f3f1
[varLib] Rewrite axis configuration code
...
We do not accept nonstandard axes if <axes> element is not present.
Breaks one test. Needs updated expectations.
Soon we'll be generating avar as well and all will be better, much better.
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
e73cc7ae34
[varLib] Move code around
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
51fd216c62
[varLib] Towards encoding all name languages
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
80c020d260
[varLib] Remove "custom" axis
...
This was added before when glyphsLib was always exporting the (unused)
custom axis. It doesn't now, so remove.
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
242faa798a
[varLib] Remove unused build(..., axisMap) argument
...
Axis map should be specified in designspace file now.
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
c922962056
[varLib] Minor
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
5a21b60ed9
[varLib.designspace] Add main functionality
...
Loads designspace file from commandline and pretty-prints it.
2017-04-12 21:54:43 -07:00
Behdad Esfahbod
8c62165008
[varLib] Build MVAR table
...
Does not implement gasp table variations, but the rest should work.
2017-04-11 11:10:54 -07:00
Behdad Esfahbod
86549315fd
[varLib.merger] Fix recombining of multiple PairPosFormat2 subtables
...
Gosh! This is the kind of thinko that doesn't happen with less dynamic languages...
Good one hour of debugging at TYPO Labs. Glad this one is fixed finally!
Fixes https://github.com/fonttools/fonttools/issues/888
2017-04-06 15:29:13 +02:00
Behdad Esfahbod
4c07266971
[varLib] Minor
2017-04-06 15:29:09 +02:00
Behdad Esfahbod
43060a0d08
[varLib] Do not encode gvar deltas if all values smaller than tolerance
...
Tolerance is set to .5 by default. Most designspaces never hit this since
for most, all deltas are integers anyway. Moreover, all such detas will
round to zero anyway.
2017-04-05 15:43:14 +02:00
Behdad Esfahbod
b572ae6c5b
[varLib] Do not encode gvar deltas that are all zeroes
2017-04-05 15:43:14 +02:00
Behdad Esfahbod
9798c30d57
[varLib.merger] Really recombine multiple PairPosFormat2 subtables...
...
Fixup for 49d311550c29f7501dd4bc91cb24074e3d607b77
Previous try was completely dropping the ParPosFormat2 subtables. Ouch!
Fixes https://github.com/fonttools/fonttools/issues/888
2017-03-17 20:30:56 -07:00
Behdad Esfahbod
49d311550c
[varLib.merger] Recombine multiple PairPosFormat2 subtables...
...
...if they were split because of offset overflows.
Fixes https://github.com/fonttools/fonttools/issues/888
for most common cases.
2017-03-16 17:51:59 -07:00
Behdad Esfahbod
92cb5d28d6
[varLib.merger] Shuffle _ClassDef_invert for more uses
2017-03-16 17:46:28 -07:00
Behdad Esfahbod
7f83d6d445
[varLib.merger] Add TODO item
2017-03-16 16:18:27 -07:00
Behdad Esfahbod
0f5a46b1f9
[varLib.merger] Only insert PairPosFormat1 if non-empty
...
This is proper fix for c8b2088162f1542dd29b2d370aa2a2c081452559
2017-03-16 16:15:10 -07:00
Behdad Esfahbod
c8b2088162
Revert "[varLib.merger] only insert merged PairPosFormat1 subtable if at least one font has one"
...
This reverts commit d83c2fb2090fa58f94fdf32d1aa2d2d8665cec05.
This is wrong. We should insert if and only iff there's at least one of the
fonts with a Format1. Yours doesn't look at all fonts. Since this one is not a
bugfix but improvement, I'll fix it separately.
2017-03-16 16:07:46 -07:00
Cosimo Lupo
23511fd302
[varLib.merger] set ClassDef{1,2}.Format using same logic as otTables.ClassDef.preWrite
2017-03-14 16:14:08 +00:00
Cosimo Lupo
e6125b353e
[varLib.merger] avoid reusing the same Class2Record (mutable) objects
...
Class2Record is mutable, hence doing `[rec2] * l.Class2Count` produces a list containing multiple references to the same instance. When later on we do the interpolation, modifying one would modify them all.
We need to instantiate distinct objects.
See 6f41c2ab53 (commitcomment-21310803)
2017-03-14 14:46:17 +00:00
Cosimo Lupo
d83c2fb209
[varLib.merger] only insert merged PairPosFormat1 subtable if at least one font has one
2017-03-14 14:29:10 +00:00
Cosimo Lupo
aad0d46069
[varLib.merger] fix IndexError with empty ClassDef1 in PairPosFormat2
...
https://github.com/fonttools/fonttools/pull/881#issue-213020690
2017-03-14 14:26:55 +00:00