SAKAJATI - Mobile Development

  • Increase font size
  • Default font size
  • Decrease font size
Home FAQ Windows Mobile/Phone General How to change default font?

How to change default font?

E-mail

Windows CE uses a default set of fonts that exist in ROM. You can replace these fonts by modifying the Windows CE registry. The replacement font must exist in the Windows directory on the target device.

The following table shows the locations of the fonts that you can replace through the Windows CE registry.

Font Location Registry Key
System HKEY_LOCAL_MACHINE\SYSTEM\GDI\SysFnt
Menu bar HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu\BarFnt
Pop-up menu HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu\PopFnt
Out of Memory window HKEY_LOCAL_MACHINE\SYSTEM\GWE\OOMFnt

 

To change a font, modify the following values under each registry key:

"Nm"=font-name

"Ht"=DWORD:height

"It"=DWORD:italics-flag

"Wt"=DWORD:weight

"CS"=DWORD:character-set

 

The following table describes each of these variables.

Variable Description
font-name Font name, not including the extension. For example, to load the Arial font, Arial.ttf, use the following value for the font-name variable:

"Nm"=Arial

height Font height, in pixels.
italics-flag Set to 1 for italics; 0 for no italics.
weight Font weight, which can be one of the FW_* values.
character-set

Defines the character set, which can be one of the *_CHARSET values.

 

Font weight values:

Value Weight
FW_DONTCARE 0
FW_THIN 100
FW_EXTRALIGHT 200
FW_ULTRALIGHT 200
FW_LIGHT 300
FW_NORMAL 400
FW_REGULAR 400
FW_MEDIUM 500
FW_SEMIBOLD 600
FW_DEMIBOLD 600
FW_BOLD 700
FW_EXTRABOLD 800
FW_ULTRABOLD 800
FW_HEAVY 900
FW_BLACK 900

 

Character set values:

Character set Value
ANSI_CHARSET 0
BALTIC_CHARSET 186
CHINESEBIG5_CHARSET 136
DEFAULT_CHARSET 1
EASTEUROPE_CHARSET 238
GB2312_CHARSET 134
GREEK_CHARSET 161
HANGEUL_CHARSET 129
MAC_CHARSET 77
OEM_CHARSET 255
RUSSIAN_CHARSET 204
SHIFTJIS_CHARSET 128
SYMBOL_CHARSET 2
TURKISH_CHARSET 162
JOHAB_CHARSET 130
HEBREW_CHARSET 177
ARABIC_CHARSET 178
THAI_CHARSET 222
VIETNAMESE_CHARSET 163

 

For example, to use HelveticaNeue LT 55 Roman.ttf, copy HelveticaNeue LT 55 Roman.ttf into \Windows folder and make the following changes to the registry:

[HKEY_LOCAL_MACHINE\SYSTEM\GDI\SYSFNT]
"Nm"="HelveticaNeue LT 55 Roman"
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu\BarFnt]
"Nm"="HelveticaNeue LT 55 Roman"
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu\PopFnt]
"Nm"="HelveticaNeue LT 55 Roman"
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\OOMFnt]
"Nm"="HelveticaNeue LT 55 Roman"

That's it you're done!