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

[pygame] Problems loading fonts on Windows



Hi, I'm deploying a cross platform pygame script. On windows I have had a 
report of an error thrown loading fonts because WINDIR is not defined in the 
env. Has anyone else seen this?

self.default_font = pygame.font.SysFont("courier", 12, False, False)
File "C:\Python23\Lib\site-packages\pygame\sysfont.py", line 230, in SysFont
 initsysfonts()
 File "C:\Python23\Lib\site-packages\pygame\sysfont.py", line 195, in 
initsysfonts
 fonts = initsysfonts_win32()
 File "C:\Python23\Lib\site-packages\pygame\sysfont.py", line 48, in 
initsysfonts_win32
 fontdir = os.path.join(os.environ['WINDIR'], "Fonts")
 File "C:\Python23\lib\os.py", line 417, in __getitem__
 return self.data[key.upper()]
 KeyError: 'WINDIR'