PyGame font issues

Peter Chant REMpeteOVE at CAPpetezilla.ITALSco.uk
Mon Apr 27 15:02:44 EDT 2009


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?

-- 
http://www.petezilla.co.uk



More information about the Python-list mailing list