3452 Commits

Author SHA1 Message Date
Sascha Brawer
7c082600d3 [cvar] Move decompilation for single TupleVariation out of gvar
Rename local variables to match terminology of OpenType 1.8 specification
2017-01-09 12:14:12 +01:00
Cosimo Lupo
7ec4fd0605
[varLib] replace print() with logging
Fixes #795
2017-01-09 10:37:47 +00:00
Cosimo Lupo
c0a30f8372
Update changelog 2017-01-09 10:35:40 +00:00
Cosimo Lupo
4af078a629
[varLib] re-enable building HVAR for TTFs; remove --build-HVAR option
The option was meant to be temporary, and is no longer needed since
https://github.com/fonttools/fonttools/issues/705 is now fixed.
2017-01-09 10:34:34 +00:00
Cosimo Lupo
06f3690a6c
Update changelog 2017-01-09 10:25:16 +00:00
Behdad Esfahbod
dc1a3bdb1d [OS/2] Don't fail if font does not have cmap table 2017-01-09 01:09:21 -08:00
Behdad Esfahbod
aeafda539b Oops! 2017-01-09 00:38:46 -08:00
Behdad Esfahbod
e4d88b5a38 Extra protection
Fixes https://github.com/fonttools/fonttools/issues/797
Although for the XML->binary case, that bug was already fixed
on master because of the XML populate-default changes.
This adds extra protection!
2017-01-08 23:47:29 -08:00
Behdad Esfahbod
80535c224e Fix XML->binary when LookupOrder is NOT specified
Fix for 495c6831e19ff9992fb801d2930e79c7d13736ae; bringing the intended
behavior documented in that commit.
2017-01-08 23:45:03 -08:00
Sascha Brawer
7f9ab7fc7f [gvar] Remove unused function 2017-01-05 17:54:38 +01:00
Sascha Brawer
f5a679661d [gvar] Use ttLib accessors for importing module and module class 2017-01-05 17:40:39 +01:00
Sascha Brawer
980ee57b0e [gvar] Rename gvar.decompileSharedCoords() to decompileSharedTuples()
The new name is consistent with the terminology of the OpenType 1.8
specification, which calls the decoded structure the `SharedTuples`
array.
2017-01-05 14:18:52 +01:00
Sascha Brawer
039cb48927 [gvar] Move gvar.computeMinMaxCoord() to TupleVariation.inferRegion()
Document what this helper function does, using terminology from
the OpenType 1.8 specification.
2017-01-05 13:35:27 +01:00
Sascha Brawer
39c4ef621c [cvar] Change warning message for out-of-range points 2017-01-05 08:55:36 +01:00
Cosimo Lupo
26679a9d73
feaLib.builder: fix order of {from,to}file arguments of difflib.unified_diff 2017-01-04 22:01:40 +01:00
Sascha Brawer
6275668840 [cvar] Support XML input/output for TupleVariations on constant values
OpenType TupleVariations can be used in two places:

* In the `gvar` table, they modify glyph contour points by shifting
  them towards a point in 2D space.

* In the `cvar` table, they modify constant values.

Before this change, we only had code to handle the `gvar` version
which shifts points around by delta values.

After this change, the XML parsing and generation routines of
TupleVariations can handle deltas that modify constant values in the
CVT table, as used in `cvar`.

An upcoming change will add support for the binary encoding of
TupleVariations as needed for `cvar`.
2017-01-04 18:16:14 +01:00
Sascha Brawer
01f95fc190 [gvar] Rename header fields to match OpenType specification
The initial implementation had been written with Apple's TrueType
specification, before OpenType supported variations.
2017-01-04 16:24:32 +01:00
Sascha Brawer
271987a89f [gvar] Adjust comment about broken variation fonts on macOS 2017-01-04 14:31:52 +01:00
Sascha Brawer
3420bb116c [gvar] Move TupleVariation to its own source file
The TupleVariation structure is used both for `gvar` and `cvar`.
2017-01-04 14:07:38 +01:00
Sascha Brawer
04d10cceaa [gvar] Mention renaming of GlyphVariation to TupleVariation in NEWS 2017-01-04 14:07:38 +01:00
Cosimo Lupo
dd0cf31d4e
otlLib.builder: don't specialcase tuple as it's immutable and returns itself
https://github.com/fonttools/fonttools/pull/793#discussion_r94358989
2017-01-04 13:15:18 +01:00
Sascha Brawer
1d28abdb65 [gvar] Rename GlyphVariation to TupleVariation
In the OpenType 1.8 specification, this is called TupleVariation
so let's be consistent with the spec. (The initial implementation
in fonttools pre-dates OpenType 1.8).
2017-01-04 12:41:55 +01:00
Sascha Brawer
a837a3950f [gvar] Use flag names from OpenType 1.8
FontTools has initially been implemented using the Apple TrueType
specification.  When OpenType adopted variations, some identifier
names were changed.
2017-01-03 17:09:47 +01:00
Sascha Brawer
b61b92a96a Fix inconsistent tab/space usage, for Python 3 2017-01-03 16:35:37 +01:00
Behdad Esfahbod
b0baa95f71 Update changelog 2017-01-02 20:58:27 -08:00
Behdad Esfahbod
45fa26b28c Set propagated counts while reading XML
Now reading XML and immediately writing it back to XML should be fully
supported and generate the same XML.

Code is a bit hacky (we don't have the reader object, so abuse font for
passing state down tree...).
2017-01-02 23:23:44 -05:00
Behdad Esfahbod
1eb8afbfa3 When reading from XML, populate all members that are computed
Not really all... Propagated counts are still not populated.
Most of mti_tests pass again.  Four failing now.

NB: In the code being removed in this commit, this line:

"setattr(self, conv.repeat, len(seq)+conv.aux)"

had the wrong sign for conv.aux.  Should have been a minus.
2017-01-02 23:23:44 -05:00
Behdad Esfahbod
6250b60ec3 [mtiLib] Test roundtripping XML->Python->XML as well
Most tests fail right now since when reading XML we don't set *Count
members for empty arrays; we don't set propagated counts either.
Fixes coming.
2017-01-02 23:23:44 -05:00
Behdad Esfahbod
3820a3006f XMLReader: Allow parsing XML without <ttFont> root element 2017-01-02 23:23:44 -05:00
Cosimo Lupo
9d39007aa6
Bump version: 3.4.1.dev0 → 3.5.0.dev0 2017-01-02 17:03:59 +01:00
Cosimo Lupo
f0d8c3b559
Update changelog 2017-01-02 17:02:48 +01:00
Cosimo Lupo
1a38f2da6c
[appveyor] show '2.7.13' as the py27 currently installed on Appveyor 2017-01-02 15:06:52 +01:00
Cosimo Lupo
55c03bc9ae
[appveyor] add Python 3.6 2017-01-02 14:59:28 +01:00
Cosimo Lupo
e44c4b90dd Merge pull request #793 from anthrotype/fix-classdef-builder
[otlLib] only sort ClassDefBuilder input glyphs if they are unsorted
2017-01-02 14:46:20 +01:00
Cosimo Lupo
6bacc3e6f8
[feaLib.builder] use hex istead of float for GDEF.Version to avoid fixedToFloat warning 2017-01-02 13:08:36 +01:00
Cosimo Lupo
3b3e74f90b
builder.py: only sort ClassDefBuilder input glyphs if they are unsorted
This fixes broken tests after 9e76d16, and should finally close https://github.com/fonttools/fonttools/issues/766
2016-12-31 15:51:53 +01:00
Cosimo Lupo
3ff25948ef
Revert "builder.py: try to fix non-deterministic ClassDef"
This reverts commit 9e76d1677cf955369f6f98755ac646dcf8af26b0.
2016-12-31 15:22:26 +01:00
Cosimo Lupo
9e76d1677c
builder.py: try to fix non-deterministic ClassDef
See:
https://github.com/fonttools/fonttools/issues/766#issuecomment-269858646
7d1ddb237e (commitcomment-20333287)

Should fix https://github.com/fonttools/fonttools/issues/766
2016-12-31 13:53:08 +01:00
Cosimo Lupo
20cd11b0b0
requirements.txt: fetch Brotli from PyPI 2016-12-31 13:46:33 +01:00
Cosimo Lupo
522d826eca
tox.ini: require coverage>=4.3
Coverage 4.3 was released, it includes this patch:
https://bitbucket.org/ned/coveragepy/pull-requests/118/check-source-isdir-not-just-exists-there/diff
2016-12-31 13:34:12 +01:00
Behdad Esfahbod
a0019a3e75 Minor 2016-12-30 19:18:15 -05:00
Behdad Esfahbod
36adb92f58 Remove default postRead and preWrite
The existence of those attrs now can be used for semantic purposes.
2016-12-30 19:17:56 -05:00
Cosimo Lupo
0e3c6eeaec
builder_test: test ClassDef sets with same length, to check deterministic sorting between python 2/3
See issue #766
2016-12-30 15:40:58 +00:00
Behdad Esfahbod
fa03f469c2 Merge pull request #792 from fonttools/LookupType-fixup
Lookup type fixup
2016-12-29 00:52:29 -05:00
Behdad Esfahbod
df0b3a25ca [otBase] Remove globalState object
Was only used for keeping tableTag around; just do that.
2016-12-28 20:54:57 -05:00
Behdad Esfahbod
8633b9c0ae [otBase] Remove cachingStats machinery
It's marginally useful when touching the bowels of otBase, but even
then, looks like it was broken as no code was populating it.
2016-12-28 20:44:15 -05:00
Behdad Esfahbod
ae7705e3ec Minor 2016-12-28 20:41:07 -05:00
Behdad Esfahbod
3eacc23868 Update tests for previous commit
The following sed command can be used to update TTX sources for the LookupType
change:

$ sed -i'~' 's/<!-- LookupType=\(.\) -->/<LookupType value="\1"\/>/g' *.ttx
2016-12-28 20:29:43 -05:00
Behdad Esfahbod
495c6831e1 Don't ignore Lookup.LookupType
A while back I changed code such that Lookup.LookupType is written as a
comment in XML, and ignored when compiling.  The LookupType from type
of actual subtables in a lookup were used during compilation instead.
This caused the problem where an empty lookup (one with no subtables)
would lose its lookup types, among other subtle problems.

With this change we revert above behavior, but keep the benefits: if
Lookup.LookupType is different from actual lookup type of the subtables,
compilation raises an exception.  Setting LookupType on Lookup object
or in XML is optional now, but written out by default in XML (instead
of as a comment).

This changes XML output for all GSUB/GPOS tables.  I'm sorry for the
noise.  Please update your sources.

Fixes https://github.com/fonttools/fonttools/issues/789
2016-12-28 20:11:57 -05:00
Behdad Esfahbod
293ede97a3 Try to set Count variables when importing XML
This does it for the simple cases, but not propagated ones.

Also, when writing to XML, if a Count or otherwise-computed value is
not set, don't write it out.
2016-12-28 16:45:24 -05:00