WINCE6 同時支持簡繁體

  最近兩星期在玩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,沒問題,簡繁體都能正常顯示了

 

---------------------------------------------------------------------

尊重他人勞動成果,轉載請標明出處http://www.cnblogs.com/feishanm 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章