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

[pygame] freetype problem



How stable is the freetype module ? I have been running into problems
with it hanging my app completly. The following code should demonstrate
the problem. Pressing ESC and you'll see that it has crashed. However
if you set the underline parameter to 'False' things work nicely.
I am running it on Windows 7.

# -*- encoding: utf-8 -*-
import pygame
from pygame import constants, event, display
from pygame import freetype

pygame.init()
freetype.init()
screen = display.set_mode((300, 200))
display.flip()
screen.fill(pygame.Color('White'))
display.flip()
f = pygame.freetype.SysFont('Times New Roman', 19)
f.underline = True
s, rec = f.render(u'Amazon')
screen.blit(s, (10, 30))
display.flip()

try:
    loop = True
    while loop:
        for ev in event.get():
            if ev.type == constants.QUIT:
                loop = False
elif ev.type == constants.KEYDOWN and ev.key == constants.K_ESCAPE:
                loop = False
finally:
    freetype.quit()
    display.quit()