676 Commits

Author SHA1 Message Date
Nikolaus Waxweiler
63a56b98fd _add_MVAR: set model only once, after a tables have been fetched 2019-02-04 16:03:47 +00:00
Nikolaus Waxweiler
ef1d4cd02d load_masters: actually assign font attributes 2019-01-30 15:15:28 +00:00
Cosimo Lupo
0293a392ad
varLib: apply HIDDEN flag to fvar axis if hidden=1 in designspace axis
Fixes https://github.com/fonttools/fonttools/issues/1085
2019-01-27 10:57:08 +00:00
Cosimo Lupo
93e791ab24
[varLib] use magic -0x8000 to ignore post.underline* for MVAR
googlei18n/ufo2ft#308 (comment)
googlei18n/ufo2ft#310
2019-01-16 11:25:29 +00:00
Cosimo Lupo
7d947c9fd8
[varLib] use magic 0x8000 to ignore post.underline* for MVAR
https://github.com/googlei18n/ufo2ft/issues/308#issuecomment-454079704
https://github.com/googlei18n/ufo2ft/pull/310
2019-01-15 16:16:40 +00:00
Cosimo Lupo
b2fac2333e
[varLib] allow loading masters from TTX files as well
in a designspace document, the sources' filename attribute can now contain
a relative path to a .TTX file for that master, in addition to .TTF or .UFO
(the latter, resolved through a master_finder callable as before).
2019-01-14 16:32:51 +00:00
Cosimo Lupo
48e72dab9b
varLib: use addMultilingualName for localised instance style names
designspaceLib: ensure instance localised names are set as unicode strings
2019-01-13 15:04:55 +00:00
Cosimo Lupo
e6d5b5531a
mutator: drop 'ltag' table if no longer referenced from 'name' table 2019-01-13 14:42:36 +00:00
Cosimo Lupo
acbc65c1a9
varLib: use addMultilingualName method to support localized axes 'labelname'
now that addMultilingualName method also adds mac names by default, we can use it in
varLib instead of addName.
The language identifiers are expected to be minimized, i.e. not contain default script/region
subtags -- until we implement the minimizeSubtags algorithm from ICU/CLDR:
https://github.com/fonttools/fonttools/issues/930
2019-01-13 13:39:15 +00:00
Cosimo Lupo
f88a1f6465
Merge pull request #1425 from fonttools/varlib-build-accept-ds-object
[varLib] make `build` also accept DesignSpaceDocument objects
2019-01-03 15:42:14 +00:00
Cosimo Lupo
b0a00a806f
minor: docstring [skip ci] 2019-01-03 15:41:15 +00:00
Cosimo Lupo
448b946636
varLib/designspaceLib: require font-less source to have a path; remove getSourcePath
simpler is better. Also, refactored updatePaths and added more tests to it.
2019-01-03 14:21:09 +00:00
Cosimo Lupo
39f49b785b
[varLib.cff]: shouldn't iterate through a dict while deleting keys
cherry-picked from https://github.com/fonttools/fonttools/pull/1415
2019-01-02 17:31:47 +00:00
Cosimo Lupo
1470ef7258
designspaceLib: add getSourcePath method
and remove BaseDocReader.getSourcePaths as it was broken anyway (it was assuming 'sources'
attribute of DesignSpaceDocument object was a dict, whereas it is now a list of
SourceDescriptor objects
2019-01-02 14:06:55 +00:00
Cosimo Lupo
4001ded199
override SFNTReader __deepcopy__ for 'file' isn't copyable; use it in varLib 2018-12-20 14:18:59 +00:00
Cosimo Lupo
9b4509496f
interpolate_layout: allow to pass DesignSpaceDocument as input, like varLib.build 2018-12-20 13:00:45 +00:00
Cosimo Lupo
6f317aa362
ttFont: add copy() method that return new instance with same data
and use it in varLib to copy master font
2018-12-20 12:47:43 +00:00
Cosimo Lupo
04d506072c
rename _ensure_sources to load_masters, misc refactor 2018-12-20 12:28:31 +00:00
Nikolaus Waxweiler
596b2cef80 Extract Designspace font loader into own function 2018-12-20 08:53:28 +00:00
Nikolaus Waxweiler
79835176f3 Remove unused variable 2018-12-19 18:47:00 +00:00
Nikolaus Waxweiler
31c15b7c0e Minor reorganization 2018-12-19 18:39:47 +00:00
Nikolaus Waxweiler
67d1f3598a Be clever in what we accept
See https://github.com/fonttools/fonttools/pull/1416#issuecomment-448674815
2018-12-19 18:29:34 +00:00
Nikolaus Waxweiler
e464e450ac Make build and load_designspace accept a DS object 2018-12-19 13:40:11 +00:00
Behdad Esfahbod
8e080f2a82 [varLib] Fix merging of multiple PairPosFormat2 subtables
We should invert each ClassDef1 against its own sublookup Coverage,
not the combined one.  Oops!

Fixes https://github.com/fonttools/fonttools/issues/1411
2018-12-19 06:34:40 -05:00
Denis Moyogo Jacquerye
f998688c00
Merge pull request #1413 from moyogo/STAT-1.1
Pin STAT to version 1.1
2018-12-17 20:30:32 +00:00
Behdad Esfahbod
9c3dde3ce6 [varLib] Always write tuple entries for composite glyphs (#1383)
* [varLib] Always write tuple entries for composite glyphs

Fixes https://github.com/fonttools/fonttools/issues/1381
Fixes https://github.com/googlei18n/fontmake/issues/481 partially

* Make sure at least one gvar delta is written for composites

* Add test data for composite fix

* Put in the correct issue link

* Typo

* Fix typos

* Expand comment, add link to issue

* Add ttx files for test font
2018-12-17 14:03:40 +01:00
Denis Moyogo Jacquerye
acd2a61543 [varLib] downgrade default STAT version=0x00010001 2018-12-14 15:04:32 +00:00
ReadRoberts
0586c06199 [varLib subset CFF2] Set PrivateDict nominal and default WidthX to None
@bedhad
Address issues raised in #1403

I do think setting the dummy CFF2 PrivateDict nominalWidthX and defaultWidthX to None, which leads to the charstring.width also being None,  is a good idea. I originally set them to 0, which produces a charstring width of 0, in order to avoid problems with logic that assumes that the field is good for math. However, I now think that it is better to find errors around charstring type assumptions earlier than later.

 "drop_hints()" is actually not wrong - I did look at this when making the changes. For CFF2 charstrings, self.width is always equal to self.private.defaultWidthX, so the width is never inserted. This is because in psCharstrings.py::T2WidthExtractor.popallWidth(), the test "evenOdd ^ (len(args) % 2)" is alway False.  Left to myself, I would not change this code. If the CFF2 charstring is correct, there is not a problem. if the CFF2 charstring is not correct, then both in drop_hints() and in T2WidthExtractor.popallWidth(), the logic will stack dump. I did add asserts, but am not totally sure it is worth the extra calls.
2018-12-06 11:55:48 -08:00
Behdad Esfahbod
37366b563e [varLib.featureVars] Fix overlap remainder logic
Fixes https://github.com/fonttools/fonttools/issues/1400
2018-12-05 10:33:35 -08:00
Behdad Esfahbod
93633a85ef [CFF] Move variations-specific CFF code to varLib.cff module 2018-12-04 19:22:02 -08:00
ReadRoberts
1f2600ff65 [cff2] Add subset.cff functions for CFF/CFF2 class:
desubroutinize
remove_hints
remove_unused_subroutines

Fix issue in cff2mergePen.py because of  removing CFFS2Subrs class in prior commit.
2018-12-04 18:34:22 -08:00
Behdad Esfahbod
31019eac8e [CFF] Whitespace 2018-11-30 21:46:16 -05:00
ReadRoberts
331a55588b [varlib] update model.reorderMasters() to support arbitrary mapping. 2018-11-30 10:37:34 -08:00
ReadRoberts
63c94beb20 Merge commit '889d683064cea426ac692431ee599752519cea18' into varlib-build-cff2vf
# Conflicts:
#	Lib/fontTools/misc/psCharStrings.py
2018-11-30 09:21:18 -08:00
ReadRoberts
29b1246515 [varlib] Move master list reordering into models.py
It is useful to re-order the CFF2 master font list to match the sorted location order, but doing so means touching internal fields of the model, so we'll move this into the VariationModel class.
2018-11-30 09:12:27 -08:00
Behdad Esfahbod
361e1e6aa0
Merge pull request #1377 from fonttools/varlib-interpolate-cff2
Varlib interpolate cff2
2018-11-30 00:21:13 -05:00
Behdad Esfahbod
8b1730774a [CFF] Move varLib.mutator-specific code out of subset.cff 2018-11-29 17:07:51 -05:00
Behdad Esfahbod
fb3248ff1b [CFF] Whitespace 2018-11-29 14:15:54 -05:00
Behdad Esfahbod
18cfe2371a [CFF} Rename subset.cffLib to subset.cff 2018-11-29 14:09:57 -05:00
Behdad Esfahbod
7daf9ef298 [CFF] Whitespace 2018-11-29 14:08:53 -05:00
ReadRoberts
c2abd045b3 [varLib.mutator] Add interpolation of glyph metrics.
Added interpolation of glyph advance width, from HVAR/hmtx, and derivation of new LSB.
Updated tests to match.
Needed to cherrypick from another branch an update for psCharstrings to allow the CFFSubr.draw() method to work.
2018-11-20 12:44:21 -08:00
Behdad Esfahbod
abb9d149ed [subset] Fix subsetting of VarStore
Was *so* broken.  Ouch!

Reported by Nyshadh, reproduced with Comfortaa-Regular.ttf.
2018-11-20 00:24:28 -05:00
ReadRoberts
92b5e0faaa [varLib.mutator] Fix changes lost during cherry-picking. 2018-11-19 20:35:34 -08:00
ReadRoberts
272244a822 [varLib.mutator] Merge with master head. 2018-11-19 20:12:45 -08:00
ReadRoberts
617b8c6396 [varLib.mutator] Interpolating CFF2 tables. Make more fixes per recommendations
varStore.py. Commit the correct function references.
psCharstrings.py. Add decompiler class specifically for flattening subroutinized charstrings.
mutator.py. Flatten the subroutinized charstrings, delete the Subrs.
TestCFF2VF.otf, Updated to version with subroutinization. Updated expected ttx output.
2018-11-19 20:08:00 -08:00
ReadRoberts
fddd5b2bae [varLib.mutator] Interpolating CFF2 tables. Makes fixes per recommendations
varLib.py. restore import of 'fontTools.misc.py23 import *'
varStore.py. Rename 'applyScalar' to 'interpolateFromDeltasAndScalars', and refactor common code with __git__item to a static method.
mutator.py. Update to reflect function name change to interpolateFromDeltasAndScalars. Changed some logic from one line to several lines for readability, and i to avoid flake8 warnings about line too long.
2018-11-19 20:06:16 -08:00
ReadRoberts
d43ebd5e49 [varLib.mutator] Add support for interpolating CFF2 tables
Add handling of CFF2 table to mutator.py

Add public method applyScalars() to varStore.py::VarStoreInstancer()
2018-11-19 20:06:03 -08:00
ReadRoberts
8d40bf8448 Merge commit '335c98512e674e8d130a36bd1e1391373d2c7f66' into varlib-build-cff2vf 2018-11-19 17:31:34 -08:00
Behdad Esfahbod
335c98512e [varLib] Variate GDEF LigCarets
Untested.
2018-11-19 16:46:22 -05:00
Behdad Esfahbod
a766d8d91e [varLib.mutator] Mutate GDEF itself 2018-11-19 16:45:30 -05:00