7076 Commits

Author SHA1 Message Date
Cosimo Lupo
e6033a14da
instancer: drop region if axis scalar is 0
update VarData.VarRegionCount

also set StartCoord and EndCoord to 0 (same end result as only setting PeakCoord
to 0, but this produces less noise when inspeciting the generated XML dump)
2019-03-26 18:44:50 +00: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
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
012d80db6d
instancer_test: added tests for MVAR table
I added an MVAR table to the PartialInstancer-VF.ttx test font with made-up deltas for
OS/2.yStrikeoutSize, post.underlinePosition and post.underlineThickness.
I defined 3 regions, one with only wght, one with only wdth, and one with both wdth and wght axes.
2019-03-25 13:19:38 +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
eff5a6310d
instancer_test: adjust expected cvar test result 2019-03-25 12:22:42 +00:00
Cosimo Lupo
05c22b9122
instancer_test: added tests for instantiateCvar 2019-03-25 11:09:46 +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
Cosimo Lupo
18f8a30305 TupleVariation: add scaleDeltas and roundDeltas method 2019-03-22 14:13:55 +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
Cosimo Lupo
2ee528e2fd Merge branch 'master' into partial-instancer 2019-03-21 15:26:27 +00:00
Cosimo Lupo
c6006a7f8c [glyf] remove_hinting should del program from composite glyph
Unlike simple glyphs, which always have 'program' attribute (even when empty, with no instructions)
in composite glyphs, it's the presence of 'program' attribute that determines whether
the optional WE_HAVE_INSTRUCTIONS component flag is set or not.
Thus, the trim method (with remove_hinting=True) should delete the attribute for
composite glyphs.

Fixes https://github.com/fonttools/fonttools/issues/1550
2019-03-21 12:16:54 +00:00
Cosimo Lupo
d2c462a0fb Bump version: 3.39.0 → 3.39.1.dev0 2019-03-19 16:38:33 +00:00
Cosimo Lupo
88a9e718c4 Release 3.39.0 2019-03-19 16:38:33 +00:00
Cosimo Lupo
cc6fce55c7 Update changelog [skip ci] 2019-03-19 16:29:41 +00:00
ReadRoberts
635537604d Fix for subsetting HVAR tables that have an AdvanceWidthMap when the --retain-gid option is used. Needed to make subset_test.py::test_retain_gids_cff2 tests pass. 2019-03-19 16:27:21 +00:00
Cosimo Lupo
1cb9b81861 Update changelog [skip ci] 2019-03-19 15:08:18 +00:00
Nyshadh Reddy Rachamallu
677b540265 Add ItemVariationStore (and MVAR) instantiation 2019-03-19 10:44:39 -04:00
Just van Rossum
b2f7ea3d1c
Merge pull request #1546 from justvanrossum/fix_issue1545
[ttLib/glyf] Raise more specific error when encountering recursive components. Fixes #1545.
2019-03-18 08:41:12 +01:00
justvanrossum
20c93b9fdb use RecursionError, and provide an alias for RuntimeError for Py2 2019-03-17 18:18:10 +01:00
justvanrossum
12ec7f539e improve error message 2019-03-17 15:35:35 +01:00
justvanrossum
ac2413e905 [ttLib/glyf] raise TTLibError with the offending glyph name in the error message when a component (indirectly) references itself 2019-03-17 15:30:20 +01:00
Nikolaus Waxweiler
5290e831a1 Remove pyftinspect (#1542) 2019-03-15 11:03:20 -07:00
Nikolaus Waxweiler
4921d97d02 Revert "Remove pyftinspect"
This reverts commit d3d550976a7455f16831118446cc431da647e081.

This was an accidental commit.
2019-03-15 15:23:54 +00:00
Nikolaus Waxweiler
d3d550976a Remove pyftinspect 2019-03-15 15:17:51 +00:00
Khaled Hosny
45861a15ca [feaLib] Reject invalid lookupflag without a value
Fixes https://github.com/fonttools/fonttools/issues/1538
2019-03-15 14:13:46 +02:00
Khaled Hosny
250eac4cae [feaLib] Correctly handle lookupflag 0 in asFea()
Part of https://github.com/fonttools/fonttools/issues/1538
2019-03-15 14:13:46 +02:00
Martin Hosken
27d8d1bda0 Update tests 2019-03-15 11:16:51 +07:00
Martin Hosken
06ed699785 Compress type 1 GPOS tables better 2019-03-15 10:50:13 +07:00
Nikolaus Waxweiler
079f68350f [designspaceLib] Document proposed public.skipExportGlyphs lib key (#1534)
* Document proposed public.skipExportGlyphs lib key
2019-03-14 16:06:05 -05:00
Nyshadh Reddy Rachamallu
d91caaf915 Add cvar instantiation 2019-03-14 10:59:15 -04:00
Cosimo Lupo
abae80d730 [feaLib] make 'forceChain' an optional kwarg for barkward compat
See discussion at:
https://github.com/fonttools/fonttools/pull/1511#issuecomment-472425283
2019-03-13 15:11:53 +00:00
Cosimo Lupo
126a2d9c38 Add partialInstancer_test.py and PartialInstancerTest-VF.ttx
Currently tests the instantiateGvar function only.
The test font contains two axes and a single glyph.
I shall make add more complexity later.
2019-03-12 19:44:33 +00: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