1. pygame
  2. pygame
  3. pygame
  4. Issues

Issues

Issue #70 open

Font can't play with pkg_resources and py2exe

René Dudfield
created an issue

== Jamie Lennox, 2011-05-13 01:18:44 -0700 ==

{{{

For whatever reason, when i freeze an application with py2exe using the default font (eg Font(None, size)) fails and it parachutes.

What i've found to get around it is to include a font and specify it by name. This works, but what i would like to do in this case is to include the font in my egg/exe and use pkg_resources to get it out.

pkg_resources.resource_stream gives a python file handle. pkg_resources.resource_string gives a string buffer of the file. pkg_resources.resource_filename is supposed to extract the file from the egg to a tmp dir and return a filename, but it doesn't work with zips and frozen (throws NotImplemented).

I guess the major bug is why py2exe and fonts don't work together. The more easily achievable (maybe, i don't know how openttf works) would be to allow Font to take a filehandle such that i could just pass the resource_stream output to it.

}}}


Comments (5)

  1. Log in to comment