Pygame not responding when trying to show texts on macOS Sierra

Viewed 424

I've installed pygame version 1.9.4 on python 3.5.3 using instructions on programarcadegames.com. When I use pygame to draw lines and shapes it's just fine but when I try to use pygame.font.SysFont the pygame is not responding anymore. For example when I run following code a non-responsive pygame window will show up:


import pygame

pygame.init()

BLACK = (0, 0, 0)
WHITE = (255, 255, 255)

size = (400, 500)
screen = pygame.display.set_mode(size)

done = False
clock = pygame.time.Clock()

while not done:

    for event in pygame.event.get():  # User did something
        if event.type == pygame.QUIT:  # If user clicked close
            done = True  # Flag that we are done so we exit this loop

    screen.fill(WHITE)

    font = pygame.font.SysFont(None, 25, True, False)

    text = font.render("Some Text", True, BLACK)
    screen.blit(text, [0, 0])

    pygame.display.flip()
    clock.tick(60)

pygame.quit()

1 Answers
Related