WinCE系統字型的設定

2021-05-24 09:36:46 字數 2390 閱讀 2487

確實很久沒有寫blog了,感覺有些對不住曾經看我blog的朋友。剛從美國回來,由於專案原因,春節都在美國工作,現在有點時間,先寫一篇簡單的,介紹一下wince字型的設定。

wince系統字型的設定是通過登錄檔實現的,目前提供以下幾種系統字型的設定:

系統字型:hkey_local_machine/system/gdi/sysfnt

選單字型:hkey_local_machine/system/gwe/menu/barfnt

彈出視窗字型:hkey_local_machine/system/gwe/menu/popfnt

記憶體不足錯誤視窗字型:hkey_local_machine/system/gwe/oomfnt

每一種系統字型的設定子項都是一樣的,如下:

"nm":           要使用字型的名字,比如arial,georgia等

"ht":             字型的高度

"it":               是否斜體,0表示正常,1表示斜體

"wt":             加粗程度

"cs":             所使用的字元級,預設是0,為ansi_charset,字符集在wingdi.h中定義

在使用一種字型之前,要確認你的wince系統支援這種字型,如果不支援,你需要新增字型,在catalog items view中選擇core os->fonts,然後選擇要新增的字型就可以了,需要重新編譯整個wince工程。

編譯完工程之後,開啟release目錄下編譯好的工程中的project.reg檔案,新增系統字型設定的配置資訊如下:

[hkey_local_machine/system/gdi/sysfnt]

"nm"="georgia"字型名字

"ht"=dword:fffffff4字型高度

"it"=dword:1斜體

"wt"=dword:190

"cs"=dword:0

[hkey_local_machine/system/gwe/menu/barfnt]

"nm"="tahoma"

"ht"=dword:fffffff6

"it"=dword:0

"wt"=dword:2bc

"cs"=dword:0

[hkey_local_machine/system/gwe/menu/popfnt]

"nm"="tahoma"

"ht"=dword:fffffff4

"it"=dword:0

"wt"=dword:190

"cs"=dword:0

[hkey_local_machine/system/gwe/oomfnt]

"nm"="tahoma"

"ht"=dword:fffffff4

"it"=dword:1

"wt"=dword:190

"cs"=dword:0

這段配置只是改變了系統字型的名字,大小並支援斜體,然後重新make image一下就可以了。具體效果如下:

可以看到字型已經改變,wince還支援cleartype字型,具體的實現只需要新增如下登錄檔配置:

[hkey_local_machine/system/gdi/cleartype]

"default"=dword:00000001

重新make image以後,執行效果如下:

cleartype字型是微軟的技術,可以使字型看上去更加清晰圓滑,從上面的兩張效果確實可以比較出來。

今天就寫到這裡,以後有時間再寫。

WinCE系統字型的設定

確實很久沒有寫blog了,感覺有些對不住曾經看我blog的朋友。剛從美國回來,由於專案原因,春節都在美國工作,現在有點時間,先寫一篇簡單的,介紹一下wince字型的設定。wince 系統字型的設定是通過登錄檔實現的,目前提供以下幾種系統字型的設定 系統字型 hkey local machine sy...

WinCE系統字型的設定

wince系統字型的設定是通過登錄檔實現的,目前提供以下幾種系統字型的設定 系統字型 hkey local machine system gdi sysfnt 選單字型 hkey local machine system gwe menu barfnt 彈出視窗字型 hkey local machi...

Android 設定字型不隨系統的字型變化而變化

一般在activity裡面新增如下 override public void onconfigurationchanged configuration newconfig override public resources getresources return res 另外,比如在 層自定義的文字...