~silnrsi/smith/+git/fonttools-master:mmap

Last commit made on 2017-02-13
Get this branch:
git clone -b mmap https://git.launchpad.net/~silnrsi/smith/+git/fonttools-master

Branch merges

Branch information

Recent commits

a9cb61d... by BehdadEsfahbod

[mmap] Make tests pass again

Which also means we don't have tests for overwriting a file :).

a81265c... by BehdadEsfahbod

[WIP] TTFont: Use mmap if possible

As discussed here:
https://github.com/behdad/fonttools/issues/580#issuecomment-211110222

Before:
$ python -m timeit 'from fontTools.ttLib import TTFont; TTFont("sazanami-gothic.ttf")'
10 loops, best of 3: 66.9 msec per loop

After:
$ python -m timeit 'from fontTools.ttLib import TTFont; TTFont("sazanami-gothic.ttf")'
10000 loops, best of 3: 110 usec per loop

That's a 600x speedup!

Fixes https://github.com/behdad/fonttools/issues/482

HOWEVER, it reintroduces https://github.com/behdad/fonttools/issues/302
Or worse, we'll crash when overwriting:

$ cp Lobster.ttf t.ttf
$ ./ttx -o ./t.ttf ./t.ttf
Dumping "./t.ttf" to "./t.ttf"...
Dumping 'GlyphOrder' table...
Bus error (core dumped)

IMO we should fix this by changing both XML and font output routines to,
instead of calling open, use os.tmpfile(), create output in a new file
and then rename it to the final destination. It has the benefit of not
leaving a half-written output file behind if an exception occurs. The
tempfile.NamedTemporaryFile also comes handy.

While checking those out, tempfile.SpooledTemporaryFile also comes handy,
when it's available, to replace BytesIO in the following part of TTFont.save():

 # write to a temporary stream to allow saving to unseekable streams
 tmp = BytesIO()

Looks like we need to start misc.fileTools to abstract the details away.

7cf22d0... by Sascha Brawer <email address hidden>

[feaLib] Move test file include0.fea into test data subdirectory

Move the other include files into a new subdirectory inside `data`.
Mention the changed behavior of include statements in NEWS.
See https://github.com/fonttools/fonttools/pull/838.

75133fc... by Miguel Sousa <email address hidden>

[feaLib] Make `include()` work like makeotf

78d11e3... by Cosimo Lupo <email address hidden>

Bump version: 3.7.0 → 3.7.1.dev0

9207b13... by Cosimo Lupo <email address hidden>

Release 3.7.0

5ba9df9... by Sascha Brawer <email address hidden>

Mention in NEWS that bug 833 has been fixed

https://github.com/fonttools/fonttools/issues/833

7068586... by Sascha Brawer <email address hidden>

Preserve ordering of glyph alternates when round-tripping through TTX

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.

a920119... by Sascha Brawer <email address hidden>

Tell git to ignore *.egg packages

For example, `sh run-tests.sh` lays a lot of eggs.

b31ed09... by Sascha Brawer <email address hidden>

Support glyph names with dashes

The OpenType Feature File Syntax has been changed to support dashes:
https://github.com/adobe-type-tools/afdko/issues/152

Resolves https://github.com/fonttools/fonttools/issues/559.
Needed for https://github.com/googlei18n/fontmake/issues/249.