920 Commits

Author SHA1 Message Date
Cosimo Lupo
41fb1ba1bc Merge pull request #975 from googlei18n/master
[varLib.interpolate_layout] Allow disabling avar mapping
2017-05-24 10:07:08 +01:00
Cosimo Lupo
a4861a16cc
use logging.warning() instead of deprecated logging.warn()
functionality is identical, the latter is deprecated:
https://docs.python.org/3/library/logging.html#logging.Logger.warning
2017-05-24 09:49:37 +01:00
Khaled Hosny
61670fc652 Use logging module for these warnings
Not sure if warnings module was used intentionally here, but the
messages looked odd compared to other FontTools messages.
2017-05-24 10:00:55 +02:00
Behdad Esfahbod
c96f83cc30 [varLib.interpolate_layout] Allow disabling avar mapping
See https://github.com/fonttools/fonttools/issues/950#issuecomment-303641054
2017-05-24 00:26:35 -07:00
Behdad Esfahbod
dbc54a2429 [varLib.models] Mark VariationModel.interpolateFromDeltasAndScalars static
This correctly reflects that all we need to interpolate is deltas and
scalars.
2017-05-23 01:01:07 -07:00
Behdad Esfahbod
39d059ef08 Revert "[varLib.models] Minor"
This reverts commit 49df768cd3d1dd2c39933e3c07d214013d50ef60.

That was accidentally pushed!
2017-05-23 00:54:23 -07:00
Behdad Esfahbod
7ee1d2e2d5 [varLib.merger] In InstancerMerger, compute scalars once
Using new VariationModel API to separate scalar calculation from
interpolation.
2017-05-23 00:54:11 -07:00
Behdad Esfahbod
bc546dec10 [varLib.models] Add VariationModel.interpolateFromMastersAndScalars() 2017-05-23 00:54:11 -07:00
Behdad Esfahbod
53b7ea4612 [varLib.models] Add VariationModel.interpolateFromDeltasAndScalars() 2017-05-23 00:54:11 -07:00
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