Python – Can’t create games with pygame

fontspygamepython

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

Best Answer

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.