I tried py2exe, cx_freeze and got nowhere with those even using this site, made some progress with pygame2exe. I read the two or three other posts dealing with this, but despite having my setup file the same as instructed, and also putting in the freesansbold.ttf I still get the 'has requested the runtime to terminate in an unusual way' error.
I will go into some details, but what is strange is if I set my text to a standard thing like "Arial" like was suggested here (Pygame Distribution - Runtime Error) and the app it creates DOES work, but the problem is my game is an rpg, and if the text is not the freesanbold it spills everywhere and is unreadable, so basicly I HAVE to have that text.
Here is how I had my font code initially:
font=pygame.font.SysFont(None, 48)
Then I changed it to:
font=pygame.font.SysFont("freesansbold.ttf", 48)
and included the .ttf in the folder, but to no avail. AGAIN if I change this to 'Arial' then the pygame2exe creates a working file, but I need the freesanbold because of text issues.
Here is the pygame2exe code, which i copied exactly from the wiki:
def isSystemDLL(pathname):
# checks if the freetype and ogg dll files are being included
if os.path.basename(pathname).lower() in ("libfreetype-6.dll", "libogg-0.dll","sdl_ttf.dll"): # "sdl_ttf.dll" added by arit.
return 0
return origIsSystemDLL(pathname) # return the orginal function
py2exe.build_exe.isSystemDLL = isSystemDLL # override the default function with this one
I have tried putting .dlls in the folder, nothing. It is probably a super simply fix, but I have been at this for days, and I can't figure it out.
Likewise I followed the wiki (http://pygame.org/wiki/Pygame2exe) here exactly but the problem is I get the runtime error even when the .ttf file is placed in the folder.
I am out of ideas, thanks for any help...
I had this same issue with the default system font. Really quite silly. I ended up using
pygame.font.SysFont("Arial", 16)
which worked without me having to include anything.My workaround for this problem was to copy freesansbold.ttf to my project directory, and to use
pygame.font.Font("freesansbold.ttf", 16)