[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Default Font Not Found



Aaron Maupin wrote:
Kris Schnee wrote:

According to
my notes I've faced this problem before, and dealt with it by copying
freesansbold.ttf from the Windows directory to the \dist directory of my
game. But this time that had no effect!

I had this exact problem. Copying the font file into the dist directory no longer worked. To solve it, I loaded the font file directly by name. For example,

font = pygame.font.Font("freesansbold.ttf", 17)

That works! I was creating a "Pen" object with the call

pen = Pen()

which gave it the default options of None for the font and 24 for the size. I replaced the None with "freesansbold.tff". Unfortunately, the font then looked substantially different than before, and the wrong size! I fiddled with it and picked 17 for the size. So, my demo is playable as an EXE now. Thanks.

Kris