Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#17 pygame renderer - font loading

v0.93
open
nobody
None
5
2003-10-08
2003-10-08
No

In pygame2D.py:

try:
self.font = pygame.font.Font("font.ttf", 14)
except:
print "Couldn't find arial.ttf - resorting to
default font"
self.font = pygame.font.Font(None, 12)
pyui.locals.TEXT_HEIGHT = self.font.get_height()

=> try to load 'font.ttf' but report an error
about 'arial.ttf'.

Also, when the default font is used, the interface is very
messed up (bordering unusable). Settings the default
font size to 18 instead of 12 seems to solve that.

Shouldn't we try to load 'arial.ttf' from "%WINDIR%
\Fonts" on the Windows platform. This would work
better 'out of the box'.

Baptiste.

Discussion

  • Logged In: NO

    I get "Couldn't find arial.ttf - resorting to default font" with
    v.1.0

     
  • Logged In: YES
    user_id=77754

    I found the same problem. I use Linux so setting the default font directory for
    windows would do nothing. If there could be a free font thrown in with the install
    and then put in the site-packages/pyui/fonts dir and linked there that would work.