PyGame font issues

Evan Kroske e.kroske at gmail.com
Tue Apr 28 19:19:21 CEST 2009


Peter Chant wrote:
> Chaps,
>
> I have the following code:
>
> if pygame.font:
>     font = pygame.font.Font(None, 36)
>     #font = pygame.font.Font('liberationserif',36)
>     text = font.render("Esc to quit.", 1, (10, 10, 10))
>     textpos = text.get_rect()
>     textpos.centerx = background.get_rect().centerx
>     background.blit(text, textpos)
>
> but I get the error:
>
> Traceback (most recent call last):
>   File "g6.py", line 77, in <module>
>     font = pygame.font.Font(None, 36)
> RuntimeError: default font not found 'freesansbold.ttf'
> bash-3.1$      
>
> Now swapping the comments on the font= lines to use liberationserif which
> definitely is on my system I get a similar fault.  Any suggestions on a
> remidy?
>
>   
I'm certain that you would get a better response to this question on the 
Pygame mailing list, pygame-users at seul.org. Maybe you'll get a response 
here, but if you're going to have more than one question about PyGame, 
it would be a good idea to join the official PyGame mailing list.

Regards,
Evan Kroske



More information about the Python-list mailing list