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

Re: [pygame] default font



On Wed, Aug 12, 2009 at 04:04:56PM +0200, Bo Jangeborg wrote:
> Two problems with pygame.font.SysFont:
> 
> 1.
> How do I determine which font face it actually returned ? If
> it fails it returns the default font, but how do I know that
> it failed ?
> 
> 2.
> If I make an exe file with py2exe,  freesansbold.ttf is not copied
> with it. So when I use pygame.font.SysFont it fails without
> an error message and just terminates the application. Try: and
> except: wont catch it which seems a bit harsh. It Took me a while
> to figure it out.
> I tried to put the font in the same directory as the exe and
> in the library.zip, and all over the place in the build
> directory but neither works. Any way to make it work ?
> Or is it broken ?
> 
> Bo)

Personally I never use the default font. I always include the ttf file 
with my game's data files, and load it explicitly.

However, there is a workaround for the problem you describe here:

  http://pygame.org/wiki/Pygame2exe

I don't know how current that page is.

---
James Paige