previously (only on Python 2), the following line was silently coercing to Unicode using default 'ascii' encoding, whenever the input string was a `bytes` string (same as `str` in PY2):
namerecord.string = string.encode(namerecord.getEncoding())
On Python 3, the line above would crash, since bytes objects don't have an `encode` method (and rightly so).
`setName` should now accept both Unicode or bytes, but will issue a warning if the latter are used.
API Change:
This will change XML output for GSUB/GPOS/GDEF/MATH/BASE/JSTF/...
Scripts that set the Version for those to 1.0 or other float values
also need fixing. A warning is emitted when code or XML needs fix.
This is also what VTT does when one does "Prepare font..." and a character is not present in the character groups template file ("CharGrp.txt"): it gets assigned to the default "AnyGroup" group, or 0.
Note that the TSI1 and TSI3 tables do not raise when a glyph name is in the glyphOrder but is missing in their internal mapping; they instead write an empty entry.
This makes easier to merge TSI* tables from different fonts or from earlier revision of the same font containing only a subset of the glyphs.
In the upstream google/brotli, if the `decompress` function receives an empty byte
string, it returns a brotli.error; whereas in 'brotlipy' it does not raise but
returns an empty string b"":
https://github.com/python-hyper/brotlipy/issues/43#issuecomment-240378257
This test case asserts that when 'totalCompressedSize' in the WOFF2 header is
incorrectly set, the woff2 reader fails -- either because the brotli decoder
raises an exception, or it returns a string whose length is not the one expected.
Fixes https://github.com/behdad/fonttools/issues/314
Previously the warning message was wrong (probably a regression)
as it was reporting the the length of all kern data as "excess".
Fixing that, I see 4 bytes excess in Calibri. Up to 4 is alright,
since many compilers add padding and wrongly add 4 instead of 0
sometimes.
Where more than one run is used, it's only the first run's first point
that is absolute, all other values are relative.
Similar fix landing in FreeType soon. Fixes lizzard glyph (glyphname
"dollar") in Zycon.