3431 Commits

Author SHA1 Message Date
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
Behdad Esfahbod
7d1ddb237e [otlLib] Make ClassDef sorting deterministic
Fixes https://github.com/fonttools/fonttools/issues/766
2016-12-28 15:44:19 -05:00
Behdad Esfahbod
88026de510 Merge pull request #790 from fonttools/cmap-decompile-skip-gid0
In cmap decompile skip gid0
2016-12-28 15:33:23 -05:00
Behdad Esfahbod
8dada08d4d [mtiLib] Enable cmap test now that it passes
Was failing before 312203b6610f513509063dfc7e823bbf9ea55e29
2016-12-27 18:42:09 -05:00
Behdad Esfahbod
312203b661 [cmap] Skip gid=0 entries when decompiling cmap
gid=0 means "not mapped".  Many of the cmap formats use this to
optimize byte encoding.  When reading these tables, we don't
want to map charcodes to gid0 in the resulting struct.
2016-12-27 18:42:03 -05:00
Behdad Esfahbod
05950fcbab [cmap] Rewrite loop 2016-12-27 18:38:42 -05:00
Behdad Esfahbod
48f4e4ed04 [cmap] Factor out some common code 2016-12-27 18:36:59 -05:00
Behdad Esfahbod
7236533eb2 [mtiLib] Prepare for enabling cmap test 2016-12-27 18:16:09 -05:00
Behdad Esfahbod
91b5c2c395 Merge pull request #787 from fonttools/mtiLib-tests
Mti lib tests
2016-12-27 15:47:06 -05:00
Behdad Esfahbod
8528dc9d7c [mtiLib] Add commnent re emitting empty lookups 2016-12-27 15:22:23 -05:00
Behdad Esfahbod
4b38a20cee [mtiLib] Set lookup type even if lookup is empty
For real this time.
2016-12-27 15:19:22 -05:00
Behdad Esfahbod
6380b7041c [mtiLib] Set LookupType even for empty lookup 2016-12-27 15:17:04 -05:00
Behdad Esfahbod
7af5f9a343 [mtiLib] Port remaining types to new internal API 2016-12-27 15:15:48 -05:00
Behdad Esfahbod
86717f390b [mtiLib] Minor 2016-12-27 15:06:03 -05:00
Behdad Esfahbod
621a0613bc [mtiLib] Parse lookup-flags earlier
Such that we set them even if lookup block is empty.
2016-12-27 13:59:12 -05:00
Behdad Esfahbod
cf09589729 [mtiLib] Format 2016-12-27 13:42:17 -05:00
Behdad Esfahbod
a6178fd4fb [mtiLib] Fix and enable chained-glyph test 2016-12-27 13:40:27 -05:00
Behdad Esfahbod
1896353af0 [mtiLib] Enable testing same source against multiple tableTags 2016-12-27 13:38:51 -05:00
Behdad Esfahbod
2f800c9384 [mtiLib] Allow empty lookup 2016-12-27 13:37:11 -05:00
Behdad Esfahbod
edd46bb14a [mtiLib] Remove use of MockFont in tests
Tests pass on both Python 2 and 3 now. Yay!

MockFont is handy for mtiLib.__init__:main().  Not sure how useful it is
otherwise, and what to replace it with.
2016-12-27 13:28:06 -05:00
Behdad Esfahbod
f6294ba7bd [mtiLib] More deterministic output with MockFont 2016-12-27 13:09:39 -05:00
Behdad Esfahbod
8358a7248f [mtiLib] Make output more deterministic with MockFont
I'll first make Python 2 and 3 both generate same output for tests with
MockFont, then will probably hardcode glyphorder and remove MockFont
completely and remove hacks I added to make tests work with MockFont.
2016-12-27 13:03:37 -05:00