最近两星期在玩WINCE6,因产品需要,应用软件需支持简繁体,显示其中一种很好办,只需要加入相应的字库。如加入简体字库:
CEBASE->International->Locale Specific Support->Chinese(Simplified),选择字库SimSun & NSimSun(Subset 2_50),通常情况选择这个就够了,而SimSun & NSimSun这个太大,有10M左右,并把GB18030 Data Converter及Monotype Imaging AC3 Font Compression(对字体进行压缩,减小NK大小)勾上。编译烧入,简体字都能正常显示,但繁体字就显示为框框,原因是没有添加繁体字库。
添加繁体字库:
CEBASE->International->Locale Specific Support->Chinese(Traditional),选择MingLiU & PMingLiU(Subset 2_70),并把Monotype Imaging AC3 Font Compression勾上。编译烧入,繁体字也能正常显示。至此以为大功告成,问题出来了,发现简体字又不能正常显示,这就纳闷了,明明将简体字库添加到系统了,为啥不能显示呢?。。。。。
将繁体字库去掉,简体字又能显示出来,初步认为是注册表哪个地方有覆盖,最后发现工程下的Common.reg有疑问:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FontLink\SystemLink]
"Tahoma"="\\Windows\\simsun.ac3,NSimSun"
"Courier New"="\\Windows\\simsun.ac3,NSimSun"
"Arial"="\\Windows\\simsun.ac3,NSimSun"
"Times New Roman"="\\Windows\\simsun.ac3,NSimSun"
"Symbol"="\\Windows\\simsun.ac3,NSimSun"
; @CESYSGEN ENDIF FONTS_AC3_VERSIONS
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FontLink\SkipTable]
"Tahoma"="005c,00a5,007e,0391-03c9,2026,2116,221a,25a0-25ff"
"Arial"="005c"
"Courier New"="005c"
; @CESYSGEN ENDIF FONTS_SIMSUN
; @CESYSGEN IF FONTS_MINGLIU || FONTS_MINGLIU_2_70 || FONTS_MINGLIU_2_80 || FONTS_MINGLIU_2_90
[HKEY_LOCAL_MACHINE\SYSTEM\GDI]
"FontLinkMethods"=dword:1
; @CESYSGEN IF !FONTS_AC3_VERSIONS
; @CESYSGEN ENDIF !FONTS_AC3_VERSIONS
; @CESYSGEN IF FONTS_AC3_VERSIONS
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FontLink\SystemLink]
"Tahoma"="\\Windows\\mingliu.ac3,PMingLiU"
"Courier New"="\\Windows\\mingliu.ac3,PMingLiU"
"Arial"="\\Windows\\mingliu.ac3,PMingLiU"
"Times New Roman"="\\Windows\\mingliu.ac3,PMingLiU"
"Symbol"="\\Windows\\mingliu.ac3,PMingLiU"
; @CESYSGEN ENDIF FONTS_AC3_VERSIONS
注意红色标出的两个地方,[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FontLink\SystemLink]键名是相同的,前面是简体字库,后面是繁体字库,这下就可以肯定后面的注册表会将前面的覆盖。汗……,难道是MS的BUG?
最后在PB帮助文档上也看到
If your run-time image includes more than one East Asian locale, you must modify the values under the SystemLink registry key in common.reg to include the font files for all of your targeted locales. You must list all of the font files by using a semi-colon separator as shown in the following example:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FontLink\SystemLink]
"Arial"="\\Windows\\simsun.ttc,NSimSun;\\Windows\\msgothic.ttc,MS UI Gothic"
"Times New Roman"="\\Windows\\simsun.ttc,NSimSun;\\Windows\\msgothic.ttc,MS UI Gothic"
"Tahoma"="\\Windows\\simsun.ttc,NSimSun;\\Windows\\msgothic.ttc,MS UI Gothic"
"Courier New"="\\Windows\\simsun.ttc,NSimSun;\\Windows\\msgothic.ttc,MS UI Gothic"
"Symbol"="\\Windows\\simsun.ttc,NSimSun;\\Windows\\msgothic.ttc,MS UI Gothic"
清楚问题原因就好办了,将注册表改成
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FontLink\SystemLink]
"Tahoma"="\\Windows\\simsun.ac3,NSimSun;\\Windows\\mingliu.ac3,PMingLiU"
"Courier New"="\\Windows\\simsun.ac3,NSimSun;\\Windows\\mingliu.ac3,PMingLiU"
"Arial"="\\Windows\\simsun.ac3,NSimSun;\\Windows\\mingliu.ac3,PMingLiU"
"Times New Roman"="\\Windows\\simsun.ac3,NSimSun;\\Windows\\mingliu.ac3,PMingLiU"
"Symbol"="\\Windows\\simsun.ac3,NSimSun;\\Windows\\mingliu.ac3,PMingLiU"
OK,没问题,简繁体都能正常显示了