387 Commits

Author SHA1 Message Date
Behdad Esfahbod
87e07bc4c4 [varLib] Add kerning merger for interpolate-layout.py 2016-10-04 17:46:22 -07:00
Cosimo Lupo
79d755a837 [varLib] use both Macintosh and Windows names for fvar names; use addName method from _n_a_m_e.NameRecord; use unicode_literals
We must coerce name strings with `tounicode` because, on Python 2, the ElementTree library that we use to parse the designspace's XML will return ASCII-encoded `bytes` (PY2 `str`) whenever it can; and only returns `unicode` (PY3 `str`) when strings can't be encoded as ASCII... :(
However the `addName` method requires unicode strings (it wouldn't be able to encode them with multiple platform-specific encodings otherwise).
So we decode bytes as ASCII before passing them to addName.
2016-10-04 17:08:29 +01:00
Behdad Esfahbod
e8117f6443 [varLib] Merge same-structured kerning lookups
Code from Read Roberts.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
caa353d5dd [varStore] Generate variation for Anchors and store in GDEF
Finally!  Phew...
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
cfd7bfbb2c [varLib] Start creating variations for GPOS using Merger 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
60e8bab524 [varLib] Unbreak gvar generation
Was completely broken by 15dd7181b47b8c8225b6054c6bb257fab91eea1c as master location
tags were mismatched with fvar.  Too bad gvar was silently ignoring that.  Fix coming.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
e713f75930 [varLib] Add gvar only if base font has glyf table 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
0546a4296b [varLib] Fix typo 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
ecce5cf344 [varLib] Minor 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
9ea16fc0eb [verLib] Add a proper Merger class in varLib.merger 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
cdc6035fdf Add varLib.merger 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
1bb7605973 [varLib] Remove unused code 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
402d726692 [ot] Change Version to be an integer instead of float
API Change:
This will change XML output for GSUB/GPOS/GDEF/MATH/BASE/JSTF/...
Scripts that set the Version for those to 1.0 or other float values
also need fixing.  A warning is emitted when code or XML needs fix.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
ae93928275 [varLib] Rename fields in fvar, to accommodate for postscriptNameID 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
8e675db59b [varLib] Fix loading of designspace instances 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
24346aaa88 [varLib] Store name entries with Windows English encoding instead of MacRoman 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
4e5145ac41 [varLib] Move code around 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
d916e18595 [varLib] Refactor main() code into build() 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
12867eb7f1 [varLib] Fix buildVarRegionList() for item name changes 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
5029bb96d0 [varLib] Allow items=None passed to buildVarData() 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
f6e1d1b7c2 [varLib] Remove removed Reserved item from VarStore 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
5419e38cde [varLib] Implement merge recursion and anchor interpolation 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
26ef831edb [varLib] Add temporary file interpolate-layout.py
Just here while implementing GPOS / GSUB merging and then figure
out where the code should live.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
9ed319d0ad [varLib] Clamp values in normalizeLocation() 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
06b1840866 [varLib] Move code around 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
4fc2a3e5e1 [varLib] Move code around 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
c5ad2cb267 [varLib] Explicitly round values
It's annoying that python2's struct module doesn't err if float
is passed to it for an integer, whereas python3 does.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
3da7de7452 [varLib] Use Tag() in fvar 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
938129b802 [varLib] Use string.ljust() 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
2e350268a2 [varLib] Use models.normalizeLocation() in mutator 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
d9ee2609be [varLib] Move VariationModel and supporting code to fontTools.varLib.models
More code to be moved there in the future.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
4512a162b6 [varLib] Move designspace loading code into its own module 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
44fda3ac0b [varLib] Start OnlineVarStoreBuilder 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
c3a87f3fe4 [varLib] Fix DeltaFormat of variation Device table 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
a85dc19378 [varLib] Reuse base font's layout tables 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
72fe29359b [varLib] Start building Device table for variations 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
12a5c5895d [varLib] Enable building gvar again
Was dropped accidentlaly in 680059d0.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
76ce34b06c [varLib] Implement mapping tail optimization 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
687c2c1812 [varLib] Build indirect advance-width in HVAR
Fixes VarIdxMap implementation as well.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
32bd6bcc31 [varLib] Add optimizeVarData()
Though not really effective right now since we don't split into
multiple VarData sets.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
47a7dde070 [varLib] Make VarData.NumShorts automatic 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
f11414c93b [varLib] Implement new VarData, aka. ItemVariationData, table 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
38c88f6996 [varLib] Rename VarTuple to VarRegion 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
e7163eddb0 [varLib] Rename VarTupleList to VarRegionList
Aka. ItemVariationRegionList.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
35a401f04d [varLib] Add support for VarIdxMap, aka. DeltaSetIndexMap.
Update HVAR / VVAR to latest draft.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
831bf051c0 [varLib] Shuffle code around 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
c1717224da [varLib] Generate direct HVAR 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
e2da17e032 [opentype-gx/varLib] More work towards VariationStore
And HVAR/VVAR tables.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
4506796b32 Minor 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
4d7b5f6472 [varLib] Start implementing VariationStore 2016-09-27 19:49:41 +02:00