Sends an auxiliary tool for generating xNa Chinese Fonts

Source: Internet
Author: User

This is a new auxiliary tool used by the younger brother to fine-tune the lgame C # version in the last two days. The tool can be used to download the file name characterregiontool(c#cmd.exe] by using the program (in the c#subtype, toolsfolder, without the source code, if you want to see the source code in reverse direction, this is also true (PS: This is a standard. net program, no.. NET environment cannot run. Of course, xNa development cannot be performed without the. NET environment ......).

It should be noted that this tool has no impact or help on the released Java (Android) version and the unreleased C/C ++ and HTML5 versions, only used to automatically generate xNa development in progress 【. spritefont: The characterregions element in the file, that is, the specific Chinese characters (or other special characters, such as Arabic) that can be compiled when the xNb image font is generated ~).

This tool is added because not all Running Environments of xNa support GDI + programming (not all environments can call the system. Drawing namespace ). Therefore, once we want programs to run the same game in windows, Xbox, WP7, and mono extension environments, we cannot directly retrieve the TTF font of the system, to display the text required for game development. You can only use the spritefont text texture method that comes with xNa (or other similar text texture methods, such as the bmfont class that comes with lgame ).

PS: however, when the formal release of LGame-0.3.3, younger brother to C # version to add a cross-platform TTF font file support function, note, just read the TTF file, can not directly obtain local font support.

Currently, spritefont does not have any problems when dealing with English or other European characters, because the letters are poor, as long as we set the interval range of the alphabet in characterregions, it is enough to generate an xNb file of at most 1 MB in an English font. However, when setting a Chinese font, you can export the complete support for a Chinese font, which will generate a dozen MB of xNb files. Manual setting of Chinese characters is time-consuming, and it is difficult for users to break down long articles into <characterregion> ...... </Characterregion> child element.

This kind of reality will inevitably affect the enthusiasm of WP7 and Xbox developers (at least it will affect the Simplified Chinese version of C # Chinese game development ......), Therefore, the younger brother added the following small auxiliary tool for lgame (of course, even if it is not lgame, it can still be used where. spritefont is needed for Chinese Character support. Who is there to study how to create a graph with a Chinese character root? What is the principle ~), It is used to automatically generate the specific characterregions element of the entire Chinese text. This helps ease the difficulty of Chinese development in xNa ~

The running example is as follows:

In addition, you do not need to worry about repeated characters. By default, duplicate elements have been removed:

_______________

In addition, if you have time tomorrow, the younger brother will sort out the Java game source code again.

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.