Otherwise I get this error on python2.7:
SyntaxError: Non-ASCII character '\xc2' in file perimeterPen.py on line 87, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
If a zero value appears in a SinglePos statement, feaLib continues to
produce ValueRecords of format 0. But if a zero value appears in a
PairPos statement inside a horizontal compilation context, feaLib now
produces ValueRecords of format 4. Likewise, if a zero value appears
in a PairPos statement inside a vertical compilation context, feaLib
now produces ValueRecords of format 8.
The OpenType Feature Syntax specification is completely silent about this,
but the new behavior matches that of makeotf.
https://github.com/fonttools/fonttools/issues/633
`font.FDSelect[i]` returns a GID, not an index of `font.FDArray`.
Before this commit `.notdef` might have wrong glyph width in CharStrings,
if its fdSelectIndex is not 0 in the input font.
We now correctly handle nameid statements with surrogate pairs and
old-style macOS-encoded names (provided that fonttools supports the
specified encoding).
Resolves https://github.com/fonttools/fonttools/issues/842.
Also fixes a bug where glyph alternates in MTI feature files were
wrongly sorted by glyph name. After this change, the output is using
the same ordering as in the input MTI feature file.
Fixes https://github.com/fonttools/fonttools/issues/833.
When reduce() receives an empty sequence, it raises TypeError, unless it is given a third 'initializer' argument
ValueFormat values should default to 0, so we shall use that as initializer.
Also, the reduce() built-in is no longer available on Python 3.
It's still accessible for both py2 and py3 from functools.
Fixes https://github.com/googlei18n/fontmake/issues/241
On python2.7, the fonttools py23 module registers a 'lastResort' StreamHandler
similar to the one found in python3's logging module, that always writes
to the current value `sys.stderr`.
This also applies to any python library that imports from fontTools.misc.py23
under python2.7.
The logging module has a 'shutdown' atexit handler that flushes all the
logging handlers' streams just before the python interpreter exits.
Sometimes (e.g. when calling `python setup.py test` as in MutatorMath's test
suite), the interpreter termination ends with a traceback, which is
triggered by the atexit handler failing to flush the lastResort handler's
stream, sys.stderr
AttributeError: None has no attribute 'stderr'
This is because during module teardown, the globals (in this case 'sys')
are set to None, and the order in which modules are deleted is not
guaranteed.
See 58531934a8
We are using unicode_literals in this module since 329261b.
Because of that, on py27 sometimes a TTFont glyphOrder may end up with
a mix of `str` and `unicode` glyph names.
While I'd love to change every single 'text' string to unicode, maybe
in this case it makes sense to use the native `str` type (`bytes` on
py2, unicode string on py3) for the UV2AGL and AGL2UV dictionaries, as
glyph names can only contain ascii characters anyway.
See https://github.com/fonttools/fonttools/pull/774#discussion_r98327429