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

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



Hey,

thanks for the testing, and the patch.

I've applied your patches to cvs, and they will be in the next rc release.  

I'm not sure how to get the different faces working either.  A fix for
that will have to come after this release.

Did pygame 1.7.1rcX work ok for you with win98?


Cheers.



On 14 Aug 2005 18:30:30 +0800, retsyo@xxxxxxxx <retsyo@xxxxxxxx> wrote:
> 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
> --无忧二二族、足球大富翁...尽在亿邮短信
>