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.
A couple of modules were relying on the fact that the 'sys' module was being implicitly imported by 'from py23 import *'.
The 'py23.__all__' does not include 'sys'. I think it's better to always import 'sys' explicitly when needed.
The previous 'allXMaxIsLsb' name was misleading.
The 'allXMinIsLsb' boolean variable cooresponds to the head table's Bit 1.
This is set whenever all glyphs have the bbox.xMin equal to the respective
left sidebearing (and therefore "left sidebearing point at x=0").
Today, Apple has kindly fixed a bug in the [specification of the
meta table](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6meta.html). The existing fonttools implementation matches the
revised specification. Therefore, the comments about fonttools
intentionally deviating from Apple's spec can be removed.
The code that is being removed is untested and does not seem to make
fixing an overflow any easier. The fixer code just needs to know
which subtable caused the overflow and does not care about the item
within. As such, no point in trying to find a "right" item.
In fact, leaving item as is, is more useful in debugging overflows
as it reflects which item's offset actually overflowed.
Part of fixing https://github.com/behdad/fonttools/issues/537
otherwise `not NotImplemented` (always False) is returned from __ne__ when `type(self) != type(other)`, leading to illogic results like:
>>> from fontTools.ttLib.tables.DefaultTable import DefaultTable
>>> t = DefaultTable('test')
>>> t == 0
False
>>> t != 0
False
The latter of course should return True.