现在的位置: 首页 > 综合 > 正文

Fonts OS Design Development

2018年04月05日 ⁄ 综合 ⁄ 共 5525字 ⁄ 字号 评论关闭

You can change the appearance of your operating system (OS) by customizing
fonts. Windows Embedded CE allows you to replace fonts, specify a directory from
which the OS should load fonts, enable ClearType, enable anti-aliased fonts,
enable linked fonts, change the font size for the Help system, enable end
user-defined characters (EUDC), and enable line breaking for Asian fonts.

 

Windows Embedded CE loads system fonts from the /Windows directory on the
device by default.

You can specify the directory from which Windows Embedded CE loads fonts by
setting the HKEY_LOCAL_MACHINE/Software/Microsoft/FontPath

registry key
to the directory that you want to use. Do not include a trailing backslash when
you specify the path for the directory.

The following example shows how to change the directory from which Windows
Embedded CE loads system fonts to /Fonts.

 

[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/FontPath]
"FontPath"="//Fonts"

Replacing Fonts


For some OS designs or applications, you may need to be able to replace the
default Windows Embedded CE fonts with other fonts, including custom fonts. You
can modify the Windows Embedded CE registry to replace default fonts, to replace
fonts used on an OS design, and to replace raster fonts with TrueType fonts.

Windows Embedded CE uses a default set of fonts that exist in ROM. You can
replace these fonts by modifying the Windows Embedded CE registry and the
Project.bib file. 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 Embedded 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

  1. Modify your Project.reg project registry file by adding the registry
    keys listed in the preceding table for the fonts you want to
    replace.

  2. Under each registry key, add the following variables and values:

    "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.

  3. If you are adding a new default font to the Windows Embedded CE font
    set, add the font(s) you want to use from the Catalog. The OS will use your new
    default font automatically but keep the original system default font installed,
    depending on the locale setting.

  4. If you are adding a new default font to the Windows Embedded CE font
    set and want to remove all the unnecessary fonts that are installed with it, set
    the REPLACE_SYSGEN_DEFAULT_FONT and add the fonts you want to use from the
    Catalog.

  5. If you are setting a default font that is not part of the Windows
    Embedded CE font set, for example, a font obtained from a third-party, a font
    you have developed yourself, etc., add the font to the Project.bib file. If you
    do not want to remove all other fonts, just add your default font to the Catalog
    and it will be used automatically, as described in step 3. If you do want to
    remove unnecessary fonts, set REPLACE_SYSGEN_DEFAULT_FONT as described in step
    4.

  6. Rebuild your image.




8/27/2009

 

Windows Embedded CE provides a font linking capability so that you can link
one or more TrueType fonts to another TrueType font. Font linking is typically
used to enable Roman fonts to display non-Roman characters. Windows Embedded CE
provides font linking in the MGTT component.

To enable font linking, configure the FontLinkMethods
entry under the
HKEY_LOCAL_MACHINE/SYSTEM/GDI
registry key. You can use the
FontLinkMethods
entry to enable cell height adjustment. When enabled, the
rasterizer ignores internal leading when calculating the cell height of the
linked font. Internal leading is commonly used for Roman fonts to allow accent
marks to be placed within the interline spacing. Kanji fonts do not use internal
leading. By not including internal leading in the realization of the linked
font, the font is rendered from one to several point sizes smaller.

The following example shows the FontLinkMethods
entry.


Copy Code
HKEY_LOCAL_MACHINE/SYSTEM/GDI
FontLinkMethods=dword:n

The value for n
can be 1, 2, or 3, as defined in the following
table.

Value Description

1

Enables cell height adjustment for fonts that are created with a LOGFONT
lfHeight

member value greater than 0. The adjustment for cell height is most typically
warranted for this category of fonts. This setting is enabled in the Enterprise
Web Pad design template of the Platform Builder for Japanese
devices.

2

Enables cell height adjustment for fonts that are created with a
LOGFONT
lfHeight
member value less than 0.

3

Enables cell height adjustment for fonts that are created with a
LOGFONT
lfHeight
member value either greater than 0 or less than
0.

You can map linked fonts to base fonts by configuring the
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/FontLink/SystemLink
registry key.
The following example shows how to link Tahoma, the base font, to Trebuchet MS,
the linked font, by providing the path to the linked font .ttf file and the
linked font name.


Copy Code
[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/FontLink/SystemLink]
"Tahoma"="//windows//Trebuc.ttf,Trebuchet MS"

When using font linking, you can define one or more Unicode characters that
should be obtained from the linked font, even if they are present in the base
font. You can define these skipped characters by using the
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/FontLink/SkipTable
registry key.
This registry key is read only when the OS boots.

The following example shows that, even though there is a character in Tahoma
at Unicode character 005c, the character in the linked font will be used
instead.


Copy Code
Tahoma=005c, 00a5, 007e, 0391-03c9, 2026, 2116, 221a, 25a0-25ff

For bold fonts, the graphics device interface (GDI) determines whether to
simulate bold, using the base font only as a reference. If you use a bold font
to write a string, and the base font is bold in the .ttf file, but the linked
font is not, text in the linked font does not display as bold.







抱歉!评论已关闭.