views:

428

answers:

2

I make a game with python 2.5 and pygame.

but,I can't complete make. because this errors occured.

C:\Python26\TypeType\src\dist\Main.exe:8: RuntimeWarning: use font: MemoryLoadLibrary failed loading pygame\font.pyd
Traceback (most recent call last):
  File "Main.py", line 8, in <module>
  File "pygame\__init__.pyo", line 70, in __getattr__
NotImplementedError: font module not available
Traceback (most recent call last):
  File "Main.py", line 8, in <module>
  File "pygame\sysfont.pyo", line 253, in SysFont
RuntimeError: default font not found 'freesansbold.ttf'

Perhaps I think that the reason is because it used an object called sysfont. (Because I had the programs that did not use sysfont on an execute file and was able to start with the PC which was not installed Python in) What's wrong . sorry I'm begginer.

EDIT I can find Python2.5\Lib\site-packages\pygame\freesansbold.ttf

but same error occured.. Where may I copy freesansbold.ttf

+1  A: 

It looks like you don't have the freesansbold.ttf file on your computer in an accessible fonts folder. This font should have come with Pygame in the lib directory.

Check the installation folder for your copy of Pygame, and if it's there, modify your Python installation's font path to include that directory. If not, you'll need to find a copy or download a newer version of Pygame.

Tim
Nice!I'll try it
ffffff
I can find Python2.5\Lib\site-packages\pygame\freesansbold.ttfbut same error occured.. Where may I copy freesansbold.ttf
ffffff
Tim
+1  A: 

A simple solution would be to simply load the font directly instead of using sysfont. Just use the pygame.font.Font class and directly load a ttf file. This will also make it easier to use py2exe, and you can choose exactly the font you want.

Nikwin