Can't build games with pygame
I am making a game with python 2.5 and pygame.
but I cannot complete make. because these errors have occurred.
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 the reason is that it was using an object called sysfont. (Because I had programs that didn't use sysfont in the run file and could run from a PC that didn't have Python installed) What's wrong. sorry i'm starting.
EDIT I can find Python2.5 \ Lib \ site-packages \ pygame \ freesansbold.ttf
but the same error occured .. Where can I copy freesansbold.ttf
a source to share
It looks like you don't have a file freesansbold.ttf
on your computer in the available fonts folder. This font should have been shipped with Pygame in a directory lib
.
Check the install folder for your copy of Pygame, and if it's there, change your Python install font path to include that directory. If not, you need to find a copy or download a new version of Pygame.
a source to share
You probably found a solution, but I want to give it to someone else. Create a game with pygame. Then unzip the librairy. Go to
PythonX.X \ Lib \ site-packages \ pygame and copy freesansbold.ttf
Go back to the library file you unzipped and navigated to
Library \ Pygame
Place the freesansbold.ttf and zip library.
Now it works! :)
a source to share