Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#52 Document requirement for font file object to be open in binary mode

Feature request
closed-fixed
Paul Wise
None
5
2013-12-24
2013-12-24
norlesh
No

Just spent 3 hours tracking down a bug in my own code today which turned out to be because I was opening a TTFont using a file object without binary mode (causes chaos with the table padding). In hindsight my error is obvious 'well der, coarse it needs to read in binary mode' but I figure for the sake of adding a single word in the doc string of TTFont.init it could save the next unsuspecting newby a couple of hours.

Currently reads:
"""The constructor can be called with a few different arguments.
When reading a font from disk, 'file' should be either a pathname
pointing to a file, or a readable file object. ...

If it had of read something like:
"""The constructor can be called with a few different arguments.
When reading a font from disk, 'file' should be either a pathname
pointing to a file, or a readable binary file object. ...

my afternoon would have gone a whole lot smoother!!!

Discussion

  • Paul Wise
    Paul Wise
    2013-12-24

    • status: open --> closed-fixed
    • assigned_to: Paul Wise
     
  • Paul Wise
    Paul Wise
    2013-12-24

    Fixed in git, thanks for the report.