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).
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...).
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.
The following sed command can be used to update TTX sources for the LookupType
change:
$ sed -i'~' 's/<!-- LookupType=\(.\) -->/<LookupType value="\1"\/>/g' *.ttx
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
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.
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.
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.
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.