Rod Sheeter
ced09ff3fd
Makes life easier if ranged limits are wired from start
2019-03-06 21:54:15 -08:00
Cosimo Lupo
b6501a9406
added WIP fontTools.varLib.partialInstancer module
...
can only partially instantiate gvar for now
2019-03-06 17:43:28 -08: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
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