Wince kernel reduction (Chinese font) and separation of Font Library and kernel)

Source: Internet
Author: User

Wince kernel reduction (Chinese font) and separation of Font Library and kernel (conversion)

Each time you customize a Chinese system, NK is always about 10 MB larger than that of English. It also takes time to copy the kernel to the memory during bootloader startup, and it also occupies a lot of memory, it's a waste of about 10 MB of memory left for the system and application! I have studied it and also referred to the online materials. The following is a summary of how to reduce the size of the Chinese font and place the font on the external storage. The core idea is to reduce the size of the selected Chinese font simsun & nsimsun (sysgen_fonts_simsun) to simsun & nsimsun (subset 2_50) (sysgen_fonts_simsun_2_50. In the registry, [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ fontpath] and [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ fontlink \ systemlink] Change the storage location of simsun. AC3 or simsun. TTC.

I. Reduce the font size of Chinese Characters

1. Open the target project file, click the "Platform" menu, and then click "Settings ...", Run "clear ",

Locales: tick "English (US)" "Chinese (China )"

Default roles are: Select "Chinese (China )"

After step 2 is completed, the default font of xinsong is used in the project.

2. Return to catalog and select "core OS"> "international"> "locale spectific support"

-> "Chinese [Simplified]"

▲Agfa AC3 font Compression.

▲Simsun & nsimsun (subset 2_50): the font size is about 3 m. It is best to select subset 2_50 for wince. Therefore, replace the original Chinese font with the (subset 2_50) Chinese font, select simsun & nsimsun (subset 2_50) and right-click the component to add it. This will replace the original font. This has no effect on Chinese display and achieves kernel slimming. Optional;

Supplement: in the absence of compressed fonts, the default font size of the New Song Dynasty is more than 10 MB, and the file is simsun. if you select subset 2_50 and the file is simsun_2_50.ttc, the font size is close to 3 MB, which is also the key to crop the wince volume. Of course, if you select AC3 to compress the font library, which size can be further reduced. The compressed file is simsun_2_50.ac3, And the size is less than 2 MB.

Directory of the font library: D: \ wince500 \ public \ common \ oak \ files

▲Gb18030 data converter: Chinese character encoding standard set converter, required

3. Run the sysgen command again. In this way, the system can display Chinese characters normally without worrying about the huge NK volume.

2. Save the font to the external storage to reduce the kernel size.

There are a lot of introductions on the Internet to save the font to the SD card, Flash, and so on to reduce the size of the kernel, but note that before loading the display driver, you must load the driver of the storage device that saves the font, otherwise, the Chinese font cannot be loaded. The box is displayed after the system starts. Save the font to the storage device in the registry because the driver of the storage device has been loaded for a long time.

While I am using a hard disk, the Registry needs to be modified as follows

1. Add the following in platform. Reg:

[HKEY_LOCAL_MACHINE \ SYSTEM \ GDI]

"Fontlinkmethods" = DWORD: 1

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ fontpath]

"Fontpath" = "\ Hard Disk"; directory of the font file

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ fontlink \ systemlink]

"Tahoma" = "\ Hard Disk \ simsun. Ac3, nsimsun"; I use a compressed font, so it is simsun. ac3.

"Courier New" = "\ Hard Disk \ simsun. Ac3, nsimsun"

"Arial" = "\ Hard Disk \ simsun. Ac3, nsimsun"

"Times New Roman" = "\ Hard Disk \ simsun. Ac3, nsimsun"

"Symbol" = "\ Hard Disk \ simsun. Ac3, nsimsun"

2. Delete simsun. AC3 from the common. bib file in the project directory and confirm that the file will not be compiled into the kernel.

3. copy the file to hard disk and start the disk again.

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/wincemobile/archive/2009/01/20/3839787.aspx

PS:

First, translate the link font explanation in msdn:

Windows Embedded ce provides the ability to link one or more font libraries to another. The former is called the link font library, and the latter is called the basic font library. Once you have linked the font library, you can use the linked font to display code words that do not exist in the basic font. For example, to link a Japanese font to a Latin font, you can use the Unicode text API of the Latin font to display Japanese characters.

If the font link is enabled on your device, you can check the subkey HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ fontlink \ systemlink of the registry to determine the ing relationship between the linked font library and the basic font library, the following code shows how to add a link to the registry:

<Base font name >=< path and file of linked font>, <name of linked font>

When using a font link, you can specify that one or more Unicode characters must be taken from the link font, even if these characters exist in the basic font. To specify characters ignored from the basic font, you can use the HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ fontlink \ skiptable registry key, which is read-only when the operating system is started.

In the following sample code, the Unicode code of a character is 005c. Although the tahoma font contains this Code, only the characters in the Link font are used.

Tahoma = 005c, 00a5, 007e, 0391-03c9, 2026,211 6, 221a, 25a0-25ff

When the Chinese font support is added, the Chinese font is actually used as the link Font:

[HKEY_LOCAL_MACHINE \ SYSTEM \ GDI]

"Fontlinkmethods" = DWORD: 1

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

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ fontlink \ skiptable]

"Tahoma" = "005c, 00a5, 007e, 0391-03c9, 2026,2116, 221a, 25a0-25ff" // 0391-03c9 is Greek chars.

"Arial" = "005c"

"Courier New" = "005c"

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/codewarrior/archive/2009/05/19/4200811.aspx

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/wince_arm/archive/2009/08/17/4455642.aspx

Author guobg read the full text | comment (0) | popularity (4) | reference () | recommendation |

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.