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

RE: [pygame] py2exe and pygame fonts



hmmm,

i have tried copying the .ttf file to the dist folder, and not copying it. 
either way it wil not work for the same reason.

However, I have tried running a small trial program that simply renders some 
text to the display (using pygame.font.SysFont to find the font) and that 
seems to work fine without the font file in the dist folder.

Therefore, I guess that I must be doing something or not doing something in 
the main project that i have managed in the test program... I will keep on 
battling away.

thanks for the help,

Rob



>===== Original Message From pygame-users@xxxxxxxx =====
>Are you copying the font file to your distribution folder (dist/)?  That's
>what was happening to me.
>
>On 5/15/06, rld201 <R.L.Davidson@xxxxxxxxxxxx> wrote:
>>
>> 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
>>
>>
>>
>
>
>--
>Andrew Ulysses Baker
>"failrate"