PyGame font issues

P

Peter Chant

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?
 
E

Evan Kroske

Peter said:
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, (e-mail address removed). 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Code sharing 2
netCDF4 usage issues 0
ChatBot 4
Some pygame issues 4
Survey details won't go through using php, ajax, Mysql 3
Numeric root-finding in Python 13
RE : Gnuplot 0
Mixing Txinter and Pygame 3

Members online

Forum statistics

Threads
474,292
Messages
2,571,494
Members
48,171
Latest member
EllaHolmwo

Latest Threads

Top