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

Re: [pygame] Please help!



On Mon, Nov 1, 2010 at 5:46 PM, Zachary Uram <netrek@xxxxxxxxx> wrote:
I made these changes and verified that the font file is included in
dist\library.zip however when I run the .EXE it results in the exact
same runtime error :( Man this is a tough one!

the font file needs to be in the pygame subdirectory of library.zip for the default font file loading to find it (you can use the free tool ProcessMonitor to see exactly where the compiled exe looks for the file)

....however there is a slightly different way to solve this - load your font from a .ttf file explicitly.

so if you replace:

font = pygame.font.Font(None, 80)

with:

font = pygame.font.Font("images/freesansbold.ttf", 80)

and then copy the font into your images directory, and also add the font to the data_files list, then it should work that way as well.