[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] py2exe and pygame fonts



Dear all,

I am currently trying to use py2exe to package my pygame project for windows.

This works fine except....

my pygame program uses the pygame.font.Font functions to write to the display. 
When I run the program through py2exe no flags are thrown, but when i then run 
the  .exe file it fails and the log reports:

Traceback (most recent call last):
  File "EyeMouse.py", line 669, in ?
  File "EyeMouse.py", line 665, in main
  File "EyeMouse.py", line 397, in mainLoop
  File "EyeMouse.py", line 22, in __init__
  File "EyeMouse.py", line 205, in __init__
  File "VideoCapture.pyc", line 50, in __init__
  File "PIL\ImageFont.pyc", line 231, in load_path
IOError: cannot find font file

I am trying to use the Times New Roman font. I have tried calling this using 
pygame.font.SysFont, pygame.font.match_font, and finally storing the times.ttf 
file locally and calling it directly using pygame.font.Font. Each of these 
methods work perfectly when running from the python environment, but when 
packaged using py2exe the same log report results.

Do any of you know how i can get the fonts to be found by the packaged 
distribution?

Any help greatfully appreciated.

Rob