Using TMPro Font Assets for non-western languages

More
8 years 1 month ago #1294 by actraiser
Hello,

I habe a fundamental question on working with Textmesh Pro generated fonts and I2Localization for non-western languages. I understand that you can configure a TMPro font asset into the secondary tab in the I2Localization-prefab for each language, so in theory I can add a TMPro generated font asset with japanese characters for Japanese language and a font asset with western characters for western languages. I tested it and while the individual font asset was correctly used in each language, there is the problem that non-western languages lack numbers for instance.

So, for the font creation, I use the TMPro provided Font Asset Creator and paste in all text in all languages I use in my localization to generate only the characters I require. To test, I used the free Google Droid Sans.ttf to generate the western characters,and for Japanese I used Drod Sand Fallback.ttf which includes japanese Characters. Now it seems that Droid Sand included numbers and standard symbols (0-9, +, -) while the fallback font did not. That means in my japanese texts, there are no numbers now for instance.

My questions:

1. Do I do something wrong in the first place on how I approach Font Asset creation? Again, I just paste all text in all languages into the Font Asset Creator. I switch between the two ttfs to create individual font assets to use for each language.

2. Or is it just a problem that I used the wrong ttf font as source? I thought it was pretty hard to find (free) fonts in the first place or I did not look for the right places. Is there a standard font which supports western and CJK which "just works" and will also show numbers in the CJK-generated Font Assets?

I hope I described the problem clearly.

Greets
-act

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #1296 by Frank
Hi,

Sorry for the delay in answering, I have been sick these last couple days and couldn't do much support :-( Luckily I'm feeling better now and back at full support :-)

1. Do I do something wrong in the first place on how I approach Font Asset creation? Again, I just paste all text in all languages into the Font Asset Creator. I switch between the two ttfs to create individual font assets to use for each language.


Normally, you would like to include in a given font only the characters that you use. If you are going to use different TMPro fonts for some languages (recommended approach), then those should only include the characters for that language (not all characters for every language)

What I normally do, is to create a font for latin languages and separated fonts for other languages with a completely different character set (Rusian, Chinese, Korean, etc)
To generate each font, I go to the spreadsheet and get all texts for the specific language (e.g. only the Korean column) and run a script to remove duplicated characters. That way I end up with a string containing all characters used for that language, and only those. Alternatively, I also add the 0..9 numbers and some common signs if they are used in your UI.

Then, I take that string and use it to generate the font using the Font Asset Creator. You should pay special attention to the ttf you are going to use for that operation, given that as you described, some ttf don't contain all needed characters.

Therefore, after generating the font atlas, I double check that all characters were generated (TMPro also reports the number of characters) so that if the initial string had 50 characters, the number of characters in the generated atlas, has to be 50 as well.
If there are less than 50, it means that the ttf you used doesn't have those characters, so you should use another ttf (e.g. Arial)

Using this approach (not baking ALL characters from ALL languages) into a single atlas, will allow you to use more texture space for the Signal Distance Field that TMPro uses, therefore your text's quality will be higher without using more texture space.

2. Or is it just a problem that I used the wrong ttf font as source? I thought it was pretty hard to find (free) fonts in the first place or I did not look for the right places. Is there a standard font which supports western and CJK which "just works" and will also show numbers in the CJK-generated Font Assets?


Yes, as you are saying, some ttf may not contain the full UNICODE spectrum, so some character sets will be missing.
Most font download web sites show which character sets the font has, so may sure to check those before getting them.

One way to be safe is to use a stylized font for your latin languages (e.g. Droid Sand) and the Arial font for chinese, korean, etc. The default Arial font comes with most if not all character sets.

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

Time to create page: 0.356 seconds
Template by JoomlaShine