PyGame font issues

Peter Chant REMpeteOVE at
Mon Apr 27 21:02:44 CEST 2009


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 "", line 77, in <module>
    font = pygame.font.Font(None, 36)
RuntimeError: default font not found 'freesansbold.ttf'

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


More information about the Python-list mailing list