From: Mark H. <ski...@gm...> - 2009-03-18 22:57:57
|
I assume that your app works when not in a py2exe application, meaning that pygame has some mechanics for allowing the fonts to be loaded from somewhere other than where Windows itself stores fonts. If that is the case, you really need to look into the pygame sources to see how it does this, and why the logic is failing in the py2exe case. A common reason is that it might be looking at the __file__ attribute of a module to attempt to deduce the path to the font, but as __file__ will be in library.zip for py2exe, things will fail. Cheers, Mark On 19/03/2009 3:16 AM, Matt Ossman wrote: > I have researched this problem quite a bit and it seems that many people have had it however non of the solutions I have found worked for me. I am using Python 2.4 with pygame and I have a very basic setup script as follows: > > from distutils.core import setup > import py2exe > > setup(windows=["KioskMain.py"]) > > The script runs and tells me the following modules appear to be missing: > ['AppKit', 'Foundation', 'OpenGL.GL', 'numpy', 'objc', 'pkg_resources', 'pygame.numpyarray'] > > however it creates an exe which crashes immediately when executed, and writes the following to the log file. > > Traceback (most recent call last): > File "KioskMain.py", line 216, in ? > File "KioskMain.py", line 81, in run > File "KioskUI.pyc", line 285, in __init__ > File "InfoBar.pyc", line 19, in __init__ > File "Engine.pyc", line 22, in add_system_font > File "pygame\sysfont.pyc", line 253, in SysFont > RuntimeError: default font not found 'freesansbold.ttf' > > I have copied the 'freesansbold.ttf' file into my dist directory next to my exe and there was no difference. > > I would appreciate any help I can get on this one! > Thanks in advance. > > > > > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users |