The Python libraries come with two ways of writing unittests:
module unittest, and module doctest. In some cases, unittest
is more natural (less cumbersome) than doctest.
Wrote tests on xmlWriter for illustration.
https://github.com/behdad/fonttools/issues/54
There's a new attribute named unicode that can choose whether the
text in the XML entry is to be interpretted as Unicode, or as the
target encoding.
Previously one had to set the 'ERROR' attribute. Accept raw also.
So, for example one can say:
<cmap raw="1">
<!-- Hand-coded format13 table mapping all Unicode
characters to .notdef glyph. -->
<hexdata>
0000 0001 <!-- version numTables -->
0000 0006 <!-- platformID encodingID -->
0000000C <!-- offset -->
000D 0000 <!-- format reserved -->
0000001C <!-- length -->
00000000 <!-- language -->
00000001 <!-- nGroups -->
00000001 <!-- startCharCode -->
0010FFFE <!-- endCharCode -->
00000001 <!-- glyphID -->
</hexdata>
</cmap>
Still not working with Python 3 as psLib's PSTokenizer subclasses
StringIO and expects it to have buf and pos. Need to rewrite
this to implement StringIO internally.
misc.psLib tries to subclass StringIO. It doesn't work with
the cStringIO version.
Change doesn't seem to affect performance of CFF, which is the
biggest StringIO user.
7279302238 (commitcomment-4767054)
Extend GlyphCoordinates to transparently support float coordinates.
As a result, transformed glyph components now don't have their
coordinates rounded anymore. This slightly changes bounding box
calculations.
There's also code added, but disabled, to calculate exact glyph
bounding box, but we don't seem to actually want that.
Apparently Python 2 and Python 3 have different default
print precisions for floats. Or at least with my build it
is the case. As such, for example with amiri-regular.ttf
I see these annoying differences in the ttx output of the
two versions:
77203c77203
< <component ... scale="0.5999755859375" flags="0x1004"/>
---
> <component ... scale="0.599975585938" flags="0x1004"/>
That's just gross. Specially when these numbers are show to
humans, while we know that's just 0.6. The fixedToFloat()
routine in this module is smart enough to do that.
Not used yet.