Cosimo Lupo
7dd0390579
fix rounding deltas after applying scalars to ItemVarStore
...
ok, really time to add some better tests.
2019-03-26 16:30:57 +00:00
Cosimo Lupo
403782d5f2
fixup previous commit
...
even if none of the referenced regions in this VarData are dropped we may still
have to apply the scalars...
2019-03-26 16:21:18 +00:00
Cosimo Lupo
ef14ee9aac
keep VarData unchanged if none of its referenced regions are being dropped
2019-03-26 16:07:46 +00:00
Cosimo Lupo
24569eec9d
drop VarData if all regions referenced by it are removed
2019-03-26 15:31:20 +00:00
Cosimo Lupo
0b43253369
refactor and simplify instantiateItemVariationStore
...
we can reuse the prune_regions method defined in varStore.py to update
the VarRegionList.
also update the counts at the end (will be done automatically on compile anyway).
2019-03-26 13:48:54 +00:00
Nyshadh Reddy Rachamallu
38fc6b6611
Bug fix for ItemVariationStore instantiation.
2019-03-26 10:18:15 +00:00
Cosimo Lupo
c9a00f4ad0
minor refactoring of instantiateFeatureVariations to make it easier to test
2019-03-26 10:14:16 +00:00
Cosimo Lupo
f3aa8d5c90
fix instantiateFeatureVarationStore, was renamed instantiateFeatureVariations
2019-03-26 09:57:52 +00:00
Nyshadh Reddy Rachamallu
1585017345
Add FeatureVariation instantiation (for GSUB, GPOS)
2019-03-25 16:14:57 -04:00
Cosimo Lupo
dbad6da5c9
instancer: enumerate fvar axis indices only once then look them up
...
fvar axis tags are unique, we can compute the mapping from tag to index
once and reuse when we need them index from the tag.
2019-03-25 13:56:38 +00:00
Cosimo Lupo
2b746d6e50
instancer: unpack axis (start, peak, end) tuple instead of indexing at PEAK_COORD_INDEX
...
Makes it more readable
2019-03-25 13:41:41 +00:00
Cosimo Lupo
846e7b3ec4
instancer: round MVAR deltas at the end
...
and don't use enumerate() when iterating over region axes, as get_support() method returns a dict
2019-03-25 13:15:50 +00:00
Cosimo Lupo
bb667f6841
rename applyCvtDeltas to setCvarDeltas
...
for consistency with set{Gvar,Mvar}Deltas
2019-03-22 17:32:05 +00:00
Cosimo Lupo
fa57f7e931
instancer: only round deltas if we did scale them
2019-03-22 17:30:30 +00:00
Cosimo Lupo
29c7a11f77
minor: fix 'NameError: parser not defined'
2019-03-22 15:28:03 +00:00
Cosimo Lupo
62c98b451a
instancer: share same instantiateTupleVariationStore for both gvar/cvar
...
refactored code, hopefully simplifying things a bit.
for cvar/cvt we do the rounding only at the end after we have summed the scaled deltas
to avoid introducing unnecessary rounding errors.
2019-03-22 14:15:53 +00: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
6281f87cb6
rename partialInstancer.py to instancer.py
2019-03-21 15:30:48 +00:00
Nyshadh Reddy Rachamallu
677b540265
Add ItemVariationStore (and MVAR) instantiation
2019-03-19 10:44:39 -04:00
Nyshadh Reddy Rachamallu
d91caaf915
Add cvar instantiation
2019-03-14 10:59:15 -04:00
Cosimo Lupo
373d1b86f3
clarify in docstring that input axis limits must be in user-space coordinates
...
in case it wasn't obvious
2019-03-12 19:02:14 +00:00
Cosimo Lupo
3adcf8051c
add glyf.getCoordinates method that only returns coordinates, and no controls
2019-03-12 19:01:26 +00:00
Cosimo Lupo
355139db5a
let input axis_limits be a map axis_tag:value as well as range tuples
...
this way instanceVariableFont function can be used as drop-in replacement for
mutator.instaceVariableFont (which only accepts single-point locations, not ranges)
2019-03-12 17:59:11 +00:00
Cosimo Lupo
b4fd0e5ca0
varLib: move _{Get,Set}Coordinates to methods of glyf table class
2019-03-11 15:50:16 +00:00
Cosimo Lupo
2658b081d2
add missing deepcopy import
2019-03-08 16:24:13 -08:00
Cosimo Lupo
19ccffcd8a
set default output filename to '-instance.ttf' like mutator.py
2019-03-08 10:37:11 -08:00
Cosimo Lupo
90815e83c7
remove stray print
2019-03-08 10:28:24 -08:00
Cosimo Lupo
3c69682a16
partialInstancer: run black autoformatter
2019-03-07 19:18:14 -08:00
Rod Sheeter
aa59dc92cf
better error when pointed at a non-variable font
2019-03-06 21:58:58 -08:00
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