548 Commits

Author SHA1 Message Date
ReadRoberts
22288588a7 Clean up code formatting - re-name variables 2019-04-02 09:12:14 -07:00
ReadRoberts
ff0716f7b5 Code clean-up of items pointed out in review.
re-named variables from snake-case to camel-case throughout functions, except for 'master_ttfs' (which is ugly when camel-cased, and is the lone snake-cased in other functions) and the function names (which follows the precedent set in almost all of the rest of the module).
2019-03-26 13:54:16 -07:00
ReadRoberts
c06c5c5087 Code clean-up of items pointed out in review.
removed unused dicts
Remove print statement
Rename v_orig_mapping_i to v_orig_mapping. The suffix was left over from an earlier pass, when there was a mapping for the direct store and another one for the indirect store.
2019-03-26 10:45:04 -07:00
ReadRoberts
1fe0348bad Remove old debug pdb.set_trace(). This has already been fixed on another branch that has not yet been merged, but I need to fix it here for the VVAR test to pass. 2019-03-21 10:48:56 -07:00
ReadRoberts
ecf738b964 Add support for building VVAR table from vmtx and VORG tables.
Add test case.
2019-03-21 10:06:47 -07:00
Cosimo Lupo
df3bbbb7ad varLib: use hhea.ascent and head.unitsPerEM for phantom pts when vmtx missing
https://github.com/anthrotype/fonttools/pull/new/gvar-vmtx-phantom-pts
2019-03-05 10:02:35 -08:00
Cosimo Lupo
52ec934a02 varLib: use vmtx to compute phantom pts; fix sign of bottomSideY
when 'vmtx' is present in a font, use that to compute the third and fourth 'phantom points'.
When not present, we use the glyph bbox yMax and yMin coords.

NOTE that previously the bottomSideY was incorrectly set to -glyph.yMin (with a minus sign).
However, the minus is not needed when we use the bbox.
Positive vertical advance grows towards negative Y axis.
2019-03-04 18:33:23 -08:00
Cosimo Lupo
2dedea5f8f models: remove unused axisOrder argument from _computeMasterSupports private method
it's no longer used in the body of the method. If needed, it's accessible from self.axisOrder
2019-03-04 16:58:15 -08:00
Cosimo Lupo
f8c7950e48 models: minor: explicitly test for axisOrder is None
389cf7c56a (r32585140)
2019-03-04 16:51:53 -08:00
Cosimo Lupo
05824b8616 VariationModel: assert that locations are unique 2019-03-04 11:42:54 -08:00
Cosimo Lupo
d8152feb21 VariationModels: remove unused lowerBound/upperBound static methods 2019-03-04 11:15:06 -08:00
Cosimo Lupo
389cf7c56a VariationModel: don't use mutable list default value for 'axisOrder' parameter 2019-03-04 10:58:47 -08:00
Cosimo Lupo
fe42e1b555 varLib.plot: support 2D plots with only 1 variation axis 2019-03-01 15:29:12 -08:00
Cosimo Lupo
148b421705 models.main: actually pass normalized master locations to VariationModel 2019-03-01 13:04:52 -08:00
Cosimo Lupo
a4c6abbbb6 mutator: --no-overlap option doesn't belong to logging group of options
copypasta error
2019-02-28 09:50:58 -08:00
Cosimo Lupo
67d9830978 mutator: add --no-overlap cli option to disable setting OVERLAP glyf flags
can be useful for debugging
2019-02-28 09:46:16 -08:00
Chris Simpkins
16bb3fd605 [varLib.mutator] set OVERLAP_SIMPLE and OVERLAP_COMPOUND by default in instantiateVariableFont (#1518) 2019-02-28 09:34:43 -08:00
Cosimo Lupo
2dfb7bf0ff whitespace [skip ci] 2019-02-27 15:25:59 -08:00
Cosimo Lupo
cbb7528395 varLib.plot: fix IndexError when specifying anonymous locations on the commandline
Don't write title with the source's name where we don't have one
2019-02-27 14:08:14 -08:00
Nikolaus Waxweiler
ea24fa8d2a [varLib] load_designspace: add standard en name for ital tag 2019-02-22 11:29:33 +00:00
Nikolaus Waxweiler
8bff72139c Reinstate fixed load_masters() 2019-02-05 13:02:53 +00:00
Nikolaus Waxweiler
1e746e34ee
Revert "load_masters: actually assign font attributes" (#1486)
* Revert "load_masters: actually assign font attributes"

This reverts commit ef1d4cd02d1e46f5dac3914f547a6e4275cf3077, which caused a
crash in `interpolate_layout()` when `deepcopy`ing OTFs.

Amend code and tests while I work on a real fix.
2019-02-05 11:38:46 +00:00
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