[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] FreeSanBold Font and Screen Terminating Problems
- To: pygame-users@xxxxxxxx
- Subject: [pygame] FreeSanBold Font and Screen Terminating Problems
- From: Unnsse Khan <untz786@xxxxxxxxx>
- Date: Wed, 27 Feb 2008 20:29:05 -0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 27 Feb 2008 23:29:15 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer; bh=3DUkExGyxI63YlJseofGd7cimCIMAr06wwKzSTtJsIs=; b=q8EDfLiciASN/KjTrhVjcdhWwo7jqxJ1sgGoQt9MzslLKZCR2QnCTFLrWruiMZE9gw0gp4f/J8pM4Z34YzcgxNfA+z8RPwNHq9OA19vz75f85jEMegkxX8PdPXwMpP9aniAO8JUm4TRk4vcc6nexKJF8RFySPoqPmeQFmqFKnco=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer; b=xgYcuN/c825j6iRoT+d7P64cgaXElLOGubt3HknX0ZO6S1/u7f8FCbl/+TRFxHgv9fp6GnhK59VodZmmo13hHUwRzvZhw8dIQx7xcUZJK8KSsD3CCTPbn2Lz3jRSHunFYrgFgcAAu8DHT+IJxwA0i4oENQ3XWSEtP3rWNc8pTUg=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hello there,
I am using OS X Leopard, Python 2.5, and PyGame...
Wrote this sample program and what happens is that the screen appears
for a brief second and terminates (closes itself) and I get this error
message.
import pygame
from pygame.locals import *
def main():
# Initialize screen
pygame.init()
screen = pygame.display.set_mode((400,100))
pygame.display.set_caption('Basic Pygame program')
# Fill background
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill((250, 250, 250))
# Display some text
font = pygame.font.Font(None, 36)
text = font.render("Hello Unnsse!", 1, (10, 10, 10))
textpos = text.get_rect()
textpos.centerx = background.get_rect().centerx
# Blit everything to the screen
screen.blit(background, (0, 0))
pygame.display.flip()
# Event loop
while 1:
for event in pygame.event.get():
if event.type == QUIT:
return
screen.blit(background, (0, 0))
pygame.display.flip()
if __name__ == '__main__': main()
This is the error message:
2008-02-27 20:23:09.627 Python[93137:613] Warning once: This
application, or a library it uses, is using NSQuickDrawView, which has
been deprecated. Apps should cease use of QuickDraw and move to Quartz.
Traceback (most recent call last)
File "hello.py", line 33, in <module>
if __name__ == '__main__': main()
File "hello.py", line 16, in main
font = pygame.font.Font(None, 36)
RuntimeError: default font not found 'freesansbold.ttf'
Subsequently, I installed freessansbold.ttf into Leopard and when I re-
ran the program, nothing changed?!
How come the screen closes so fast? Also, how come it's not locating
this newly installed font?
Happy programming,
Unnsse