6963 Commits

Author SHA1 Message Date
Dave Crossland
9fe801c777
Update CODE_OF_CONDUCT.md to Github template
Added using https://github.com/fonttools/fonttools/community/code-of-conduct/new?template=contributor-covenant
2019-04-11 10:06:40 -04:00
Dave Crossland
01c63cb5be
Create CODE_OF_CONDUCT.md 2019-04-11 09:45:21 -04:00
Cosimo Lupo
5c37b5d537
Bump version: 3.40.0 → 3.40.1.dev0 2019-04-08 17:43:59 +01:00
Cosimo Lupo
e969933038
Release 3.40.0 2019-04-08 17:43:58 +01:00
Cosimo Lupo
ec10a1f8b1
Updated changelog [skip ci] 2019-04-08 17:43:02 +01:00
Cosimo Lupo
0cf54802c5
[subset] fixed VVAR subset failing with --retain-gids
Fixes https://github.com/fonttools/fonttools/issues/1552
2019-04-08 17:28:05 +01:00
Cosimo Lupo
b327287f97
designspaceLib: remove defaultLoc attribute, use up-to-date default location in findDefault
Fixes #1554
2019-04-08 16:59:01 +01:00
Cosimo Lupo
dc99925bee
instancer: always calculate inferred deltas upfront to simplify code
and instead of sumDeltas method, use in-place add operator.
2019-04-04 18:05:11 +01:00
Khaled Hosny
e082abf627 [voltLib] Allow passing file-like object to Parser 2019-04-04 18:50:36 +02:00
Cosimo Lupo
82085f5ea8
instancer: must redo iup_delta_optimize if the default coordinates have changed
If we modify the default instance coordinates, then the inferred deltas that
are left in gvar are no longer valid, so we need to calculate them using the
original default coordinates.
They are then re-optimized using the modified default coordinates.

Also, the default deltas returned from instantiateTupleVariationStore are now
already rounded to integer.
2019-04-04 15:11:23 +01:00
Cosimo Lupo
f220d36df1
instancer: merge TupleVariations left with same axes after pinning
The instantiateTupleVariationStore function now groups TupleVariation
tables that have the same axes 'tents', then merges them into a single
TupleVariation by summing their deltas. The rounding to integer happens
after summing the scaled deltas as floats, to reduce off-by-one errors.

To be able to sum gvar TupleVariation, it needs to calculate the inferred
deltas so it now takes two optional lists (origCoords and endPts) that
are passed on to iup_delta function. These only make sense for gvar
type of TupleVariation, of course, and are unused for cvar tuples.

It also run iup_delta_optimize on the gvar deltas that are left after
partial instancing and whose inferred deltas had to be interpolated.
This can be disabled with --no-optimize CLI option.

Also added calcInferredDeltas and optimize methods to TupleVariation
class, which use functions from varLib.iup module, plus tests
that exercise them.
2019-04-04 15:11:23 +01:00
Cosimo Lupo
a571eee8d6
glyf: setCoordinates must not modify input coord parameter
make a copy instead
2019-04-04 14:15:37 +01:00
Cosimo Lupo
fb914c93c4
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-04-04 14:15:14 +01:00
Cosimo Lupo
8c2f72118c
Merge pull request #1566 from anthrotype/ot-round-calc-int-bounds
arrayTools: calcIntBounds should use otRound, not round3
2019-04-04 12:48:35 +01:00
Cosimo Lupo
80306037b7
arrayTools: calcIntBounds should use otRound, not round3
Somehow we forgot to replace round -> otRound in arrayTools.calcIntBounds.
This function is used by glyf table to compute the glyphs' bounding boxes.
We already use otRound (aka 'int(math.floor(v + .5))') to round glyph
coordinates upon compiling glyf table. So the use of python3's round
in calcIntBounds was producing inconsistent roundings between the glyph
coordinates and the glyph bbox (sometimes, i.e. only when the glyf table
contains float coordinates, e.g. after instantiating with varLib.mutator).
2019-04-04 12:38:54 +01:00
Miguel Sousa
5e627c5228
Merge pull request #1564 from fonttools/svg-shapes
[svgLib] Support line, polyline and matrix transforms
2019-04-03 12:31:35 -07:00
Miguel Sousa
299b5bcf85 [svgLib] Add support for line element 2019-04-03 12:02:44 -07:00
Miguel Sousa
8d9a935eaa [svgLib] Add support for polyline element 2019-04-03 12:02:36 -07:00
Miguel Sousa
d5adee46d9 [svgLib] Complete support for matrix transforms 2019-04-03 12:02:18 -07:00
Rod Sheeter
dedf14ac8a Roughing in transform=matrix(...) 2019-04-03 11:58:05 -07:00
Cosimo Lupo
3217f9e8d7
Merge pull request #1561 from googlefonts/refactor-instantiate-varstore
refactor instantiateItemVariationStore for better test-ability
2019-04-03 16:58:06 +01:00
Cosimo Lupo
aef41419f2
gvar: log the glyph name if any exception is caught when decompiling deltas 2019-04-03 10:54:54 +01:00
Miguel Sousa
da6fe5f0e3
Merge pull request #1563 from fonttools/svgLib-ellipse
[svgLib] Add support for ellipse shape
2019-04-02 10:59:22 -07:00
Read Roberts
e782c6e9d2
Merge pull request #1551 from fonttools/VVAR-support
[varLib] Add support for building VVAR table from vmtx and VORG tables.
2019-04-02 09:38:22 -07:00
ReadRoberts
22288588a7 Clean up code formatting - re-name variables 2019-04-02 09:12:14 -07:00
Miguel Sousa
915effaad5
Merge pull request #1557 from fonttools/fontbuilder-post
[fontBuilder] Enable making CFF2 fonts with 'post' table format 2
2019-04-02 00:23:42 -07:00
Miguel Sousa
e63598f944 [svgLib] Add support for ellipse shape 2019-04-01 22:50:24 -07:00
Miguel Sousa
2c54bf7910 Use existing method 2019-04-01 21:26:07 -07:00
Miguel Sousa
86cea23de3 Un-hardcode the CFF glyph's left side bearing 2019-04-01 21:25:27 -07:00
Miguel Sousa
b0710b829b [fontBuilder] Enable making CFF2 fonts with 'post' table format 2
Before this change all OTFs wound up with 'post' table format 3
2019-04-01 21:09:21 -07:00
Miguel Sousa
30885c50f4
Merge pull request #1562 from fonttools/depr_warn-invalid_escape
Fix DeprecationWarning: invalid escape sequence
2019-04-01 15:30:36 -07:00
Miguel Sousa
ddff29cb5d Fix DeprecationWarning: invalid escape sequence 2019-04-01 14:04:14 -07:00
Cosimo Lupo
8e9fac123c
instancer_test: add more unit tests for instantiateItemVariationStore 2019-03-29 13:00:27 +00:00
Cosimo Lupo
a8853997d5
instancer_test: start adding tests for instantiateItemVariationStore helpers 2019-03-28 19:32:05 +00:00
Cosimo Lupo
5f083bdf2e
refactor instantiateItemVariationStore for better test-ability
The function now takes a VarStore instance, the fvar axes and a partial
location, and returns an array of delta-sets to be applied to the
default instance.

The algorithm is now more similar to the one used for instantiating the
tuple variation store.

Tests are coming soon.
2019-03-28 17:52:59 +00: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
Cosimo Lupo
3699f5b08c
call VarData.calculateNumShorts after scaling or dropping deltas 2019-03-26 19:02:51 +00:00
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