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

Re: [pygame] font.get_fonts() returns empty list



Arthur Elsenaar wrote:
on Mac OS X 10.3.4, I'm trying to use the system fonts, but I get an empty list:

>>> import pygame
>>> f = pygame.font.get_fonts()
Python doesn't have an easy way to access the list of system fonts on OSX. If someone could fill in the code to do this I will commit it right into Pygame.

http://cvs.seul.org/cgi-bin/cvsweb-1.80.cgi/games/pygame/lib/sysfont.py?rev=1.12
Look for the "initsysfonts_darwin" function. Basically you create a dictionary of names to TTF files.