Orx font image generation tool supports Unicode, including Chinese

Source: Internet
Author: User

Write by nine days Yan Ling (jtianling) -- blog.csdn.net/vagrxie

Discuss newsgroups and documents

History of tool generation

It is normal that the software written by the vast majority of Americans/Europeans has never considered that there are people in other languages in the world. In the past, it can be said that it is difficult to consider multiple languages in encoding. This is only possible for the sake of simplicity, but when unicode encoding is already so simple, there are still many software authors who have never considered that there are people in other languages in this world. As a non-English country, or even a country that is not even a Latin, and still owned by China, one of the world's most complex and most character languages, the situation is being improved.

When iarwain is becoming more and more Chinese users of orx and began to support orx with Custom font and Unicode, he encountered a major problem, the font image generation tool that can be found does not support Unicode. (Or the tool itself is not good enough) I also tried a few, there are many cool font tools, but unfortunately, the most supported is the Latin series. Therefore, iarwain decided to write such a tool on its own.

I was impressed by the diligent iarwain, And I was busy working on this font generation tool all weekend. Iarwain completed the first version at half past seven Montreal time. Due to some stb_truetype problems, Chinese Punctuation Marks in Some fonts were not displayed normally until the next day of Montreal time, iarwain migrates all the tools to FreeType2, which is more stable and powerful. I have tested the new tools. They are complete and available. I don't know who else will be so hard at work, maybe only code for fun can be like this. I can only say that I have served you.

In fact, although iarwain writes such a tool for orx, as I said, it is difficult to find a similar Unicode-supported font Image Generation Tool on the Internet, therefore, such a tool fills a big gap. Because it is open-source, it should be available for reference and use by any other game engine. Because the principle of displaying a Custom font is the same. In fact, in order to efficiently display the font, the principle can only be the same. Of course, this principle may not apply to games that require a complete font library (such as online games that require chat functions. If there are any deficiencies, this tool is only capable of converting text to font images, and cannot add more cool effects.

Tool Introduction

Here, we will introduce the new tool.
.

It can also be obtained from Svn of orx. SVN address:https://orx.svn.sourceforge.net/svnroot/orx。

A tool is a command line tool.

Usage:

Orxfontgen.exe-s "font size"-F "font name"-o "generate Object Name"-T "all input text"

For example, I want to use to complete the historical output of the previous tool. At the beginning, I saved the preceding documents into a file named toolhistroy.txt. (Note that the saved text must be encoded with UTF-8. This can be done with notepad ++ or ultraeditor. And copy it to the directory where the tool is located. Copy the font file msyh. TTF (from the Windows/fonts directory) of to the directory where the tool is located. I want to name the generated object msyhfont, so I use the following command execution tool:

Orxfontgen.exe-s 32-F msyh. TTF-O msyhfont-T toolhistory.txt

Then we get two things: one is the 4-channel Tag file.

 

In fact, this image can be used by any engine that supports text display.

Second, a segment of orx configuration.

[Msyhfont]

Characterlist = "()/27iou_abcdefimnoprstuwxy. I don't mean the righteousness of the two worlds either. II. Some producers only use their products to make sense, but do their work. A few benefits to the work before the moment plus diligence and half a single print calendar, the original is only Shi Ba Zhou's life and kind of kindness because the country map is filled in more than enough days to work hard, such as the beginning of the word to complete the determination of real damage to the Home Guide er work is always expected to be strong. When I am very busy, angry, and sorry, I or I am looking for support, and I am eager to change my support, and the effect of the whole article is quite late. what's more, the latest sample of this miscellaneous fruit, the European section, is more eye-catching than the Wuzhou sounding game source. However, the film version is special, and it is very vivid. the null character is a simple series of channels, which must be used by the online beauty testers. However, although the supplements were made, the trial was made to allow the speaker to say that the more powerful the voice, the more soft the voice. even though this is the story, it is difficult to solve the problem (),"

Charactersize = (32, 32, 0)

Texture = msyhfont. TGA

In this way, it is very easy to display this text. (Because of the window size, only a section in the above text is displayed)

In addition, it is obvious that although the text is white when it is generated, it can be changed by the fixed-point color of orx.

For more information about how to use orx to display text, see orx's tutorial.
Or my previous articles
.

 

The author of the original article retains the copyright reprinted. Please indicate the original author and give a link

Write by nine days Yan Ling (jtianling) -- blog.csdn.net/vagrxie

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.