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

[pygame] bugs in sysfont.py (pygame 1.6 and 1.7)



1. pygame does not support TTC( Windows truetype collection format) font(
there are some in my simplified Chinese win2k)
The simplest way to correct this problem is to replace every
[code]
if font[-4:].lower() != ".ttf": 
[/code]
with
[code]
if font[-4:].lower() not in (".ttf",".ttc"): 
[/code]
but I donno how to choose a specifical font face in this collection. To
understand what I mean, you can have a look at
http://www.unidocsys.com/document/TrueKeys/MingLiExample.jpg (from
http://www.unidocsys.com/document/TrueKeys/)
which opens Mingli.TTC, who has 2 different faces in the collection.
 
2. pygame cannot find some TTF filename with "match_font" function in windows
OS
for example, there is "ËÎÌå_gb2312 (TrueType)" (simsun.TTF ) in my win98
after running "initsysfonts()", i.e. Sysfonts.haskey('ËÎÌå_gb2312')==True
but "match_font('ËÎÌå_gb2312')" searches 'ËÎÌågb2312' in Sysfonts, obviously
it returns None.
 
the patch:
in function initsysfonts_win32(), replace
[code]        
        name = ''.join(name)
        
        _addfont(name, bold, italic, font, fonts)
[/code]        
with
[code]        
        name = ''.join(name)
        
        name=_simplename(name)

        _addfont(name, bold, italic, font, fonts)
[/code]        
It seems that there is no problem in *nix since _simplename is used in the
corresponding codes.
 





--http://www.eyou.com
--Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä  ÓïÒôÓʼþ  Òƶ¯ÊéÇ©  ÈÕÀú·þÎñ  ÍøÂç´æ´¢...ÒÚÓÊδ¾¡

--http://vip.eyou.com
--¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä  ×¢²áÄúÖÐÒâµÄÓû§Ãû

--http://sms.eyou.com
--ÎÞÓǶþ¶þ×å¡¢×ãÇò´ó¸»ÎÌ...¾¡ÔÚÒÚÓʶÌÐÅ