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
Cosimo Lupo
b2825ff6b3
[varLib.builder] fix calculation of VarData.NumShorts
...
The problem was that `break` statement: we stopped searching for SHORT columns in each delta set after finding the first, but rows can contain more than one in any order.
Fixes https://github.com/googlei18n/fontmake/issues/271
2017-03-10 12:39:06 +00:00
Behdad Esfahbod
fb0c60cd2c
[varLib.merge] Fix tests
...
Set Coverage.Format to 1. This is rather arbitrary, which is exactly
why Coverage.Format doesn't make sense and should not have been
exposed to begin with.
2017-03-08 12:52:56 -08:00
Miguel Sousa
af3df891b2
[varLib.mutator] Drop all variable tables
2017-03-04 23:30:37 -08:00
Miguel Sousa
9e4e1ffc44
[varLib.mutator] Revert Include HVAR in the list of tables to remove.
2017-03-04 12:58:00 -08:00
Miguel Sousa
7bf853ed2e
[varLib] Round advance width and LSB to integers
2017-03-04 12:54:20 -08:00
Miguel Sousa
33d12e9406
[varLib.mutator] Change ‘GX’ to ‘variable’. Include HVAR in the list of tables to remove.
2017-03-03 14:49:11 -08:00
Cosimo Lupo
94e1789fcb
[varLib.builder] fix max() arg can't be empty sequence
2017-03-01 22:20:46 +00:00
Cosimo Lupo
1883e6466b
[varLib.builder] correctly set NumShorts if optimize is False
2017-03-01 20:58:48 +00:00
Cosimo Lupo
3f8eab41f7
[varLib.builder] rename optimizeVarData to calculateNumShorts with option to optimize
2017-03-01 20:14:34 +00:00
Cosimo Lupo
3bde091807
[varLib.builder] in VarRegionList, rename AxisCount to RegionAxisCount
...
That is the name currently used in otData.py
2017-03-01 17:29:02 +00:00
Cosimo Lupo
7562115fc4
move calculation of NumShorts from otTables to varLib.builder
2017-03-01 17:27:41 +00:00
Cosimo Lupo
f97d126f96
[varLib.builder] ensure VarRegionAxis coordinates are stored as float
...
These are decompiled as F2Dot14 by otData.py, thus they are written as float when dumping to TTX
2017-03-01 17:26:07 +00:00
Miguel Sousa
3dc8e4fa95
minor change
2017-02-28 05:16:15 -08:00
Cosimo Lupo
ca95a07f24
[interpolate_layout] handle optional 'axes' item; require 'sources'
...
remove 'instances' as it's not used
2017-02-27 19:44:54 +00:00
Cosimo Lupo
c131bd93f6
[varLib] Fix AttributeError: odict.keys() has no index attribute 'index'
...
43efa63732 (commitcomment-21073943)
2017-02-27 19:17:04 +00:00
Cosimo Lupo
01d8145288
[varLib] fix undefined name 'masters'
...
Ouch!
2017-02-27 18:31:38 +00:00
Cosimo Lupo
ee9f2bf24a
[designspace] clarify that designspace items are optional in docstring
2017-02-27 18:12:31 +00:00
Cosimo Lupo
66c6662572
[designspace] refactor
...
- remove unused import
- use snake_case instead of camelCase
- add two empty lines between module-level definitions
- rename 'elt' variable to 'element'
- don't make extra dict copy in _load_axis
2017-02-27 16:59:35 +00:00
Cosimo Lupo
558e5e172d
[varLib] raise VarLibError if 'sources' missing or empty; treat 'axes' and 'instances' as optional
2017-02-27 16:34:41 +00:00
Cosimo Lupo
ba44e64108
[designspace] rename 'masters' to 'sources', like in original .designspace document
...
I don't see why our parser should call this element differently than its official name.
2017-02-27 16:21:35 +00:00
Cosimo Lupo
51f4302ec8
[designspace] if elements not defined, don't set key/value pair in returned dict
...
According to https://github.com/LettError/designSpaceDocument
> Not all values might be required by all applications.
So if any of 'elements', 'sources' or 'instances' is missing, the dictionary
returned by designspace.load will not contain those keys.
2017-02-27 16:17:13 +00:00
Behdad Esfahbod
b9ff863b2c
Move Snippets/interpolatable.py to fontTools.varLib.interpolatable
2017-02-26 10:43:11 -08:00
Cosimo Lupo
ae58d3872c
Merge pull request #864 from miguelsousa/pr857-followup
...
Followup to PR #857
2017-02-26 16:44:18 +00:00
Miguel Sousa
f061231049
[varLib] Make designspace.load() return a dictionary instead of a tuple
2017-02-26 07:49:44 -08:00
Miguel Sousa
43efa63732
[varLib] Build axes according to ’axes’ element in designspace file
2017-02-25 20:53:48 -08:00
Miguel Sousa
0dd2227e49
[varLib] Make parsing of ‘axes’ element more robust
2017-02-25 20:45:47 -08:00
Behdad Esfahbod
76e73f0ee4
[varLib] Remove TODO item
2017-02-25 10:59:31 -08:00
ReadRoberts
69ae7f0da5
Python2 .5-> Python3/2.7: "axes.has_key(iden)" -> "iden in axes"
2017-02-24 08:58:39 -08:00
ReadRoberts
33177bf65b
If the design space file uses an <axes> element, use this to define the axis map, and preserve the axis order.
2017-02-22 21:22:34 -08:00
Behdad Esfahbod
55a5ace5d8
[varLib] Update invocation command
2017-02-22 14:46:23 -06:00
Sascha Brawer
c436365cef
[varLib] Add missing import
...
After this change, the command line mentioned in the comment at the
beginning of the file works again.
2017-02-22 20:18:05 +01:00
Behdad Esfahbod
d7e8af9510
[varLib] Fix regression where GPOS values were stored as 0
...
Another fallover from merging of VariationMerger and InstancerMerger.
New code is closer to the selfless merger we want to have.
Fixes https://github.com/fonttools/fonttools/issues/834
2017-02-09 19:35:24 -08:00
Behdad Esfahbod
d801056100
[varLib] Allow merging of class-based kerning when ClassDef1's are different
...
This should allow building varfonts for a whole class of font sources
that failed so far.
2017-02-08 14:29:02 -08:00