Add Font Support for Different Languages

I was using TextMeshPro assets within my project to display text content within my project.
After creating a whole project in English, I have decided to add other language support for my game project.

I have implemented Language Localization and it worked perfectly within the project.
But after adding Language Localization, I noticed problem-related with some languages like Japanese, Chinese, Hebrew, Arabic etc…

Let me show you what problem I was getting through examples:

1> Japanese and Chinese language problem
TextField is not displaying exact content in the actual game.

2> Hebrew language problem
I don’t know why but the content within the text input field already displaying in reverse order.

I don’t know what will happen with the Arabic language but I knew Arabic will also create a problem for me.
What is the solution for this?
Shall I require to change the font type?

Yes you will need to change the font or find a font that supports all your languages.
The Open Project have a solution for setting Localized fonts open-project-1/UOP1_Project/Assets/Scripts/Localization/Editor/LocalizeTMProFontEvent.cs at b8b402bed5f6aebf634b05a7146e5ec6d4c24588 · UnityTechnologies/open-project-1 · GitHub

We will have builtin support in the future 0.12.0 release.

1 Like

Where to check for the latest version running for the Language Localisation package?

In the package manager. The current release is 0.10.0. 0.11.0 should be out next week and 0.12.0 around May

1 Like

As per this discussion, I have downloaded fonts for Chinese, Japanese, and Hebrew language fonts from Google Noto Fonts because my regular font was not supporting these languages.

For this, I required to update Font Assets file runtime based on Locale get selected as per language.

By default, Localize String Event’s UpdateString() method gets called when the string is displayed in the screen based on language selection.
Now with the same event, I want to attach Font Assets changing too.
Because English, Chinese, Japanese, and Hebrew languages required different Font Assets.
How to implement this via Coding?
Please help me to set up an automated way so I don’t require to add more human efforts in tedious work.

Thank you as always :slight_smile:

Try something like this Add feature to localization : Localize TMP font by BrettHuang2019 · Pull Request #290 · UnityTechnologies/open-project-1 · GitHub

1 Like

I have set up different Font Assets based on Open Projects’ Localize TMP Font and it started working properly.

But I was getting problems in displaying content of Chinese, Japanese, Hebrew, and Greek language content.
Though I have downloaded fonts from here:

I am attaching screenshots so you can directly see the problem I am facing plus my current setup:

Please give me some suggestions to display content in Chinese, Japanese, Hebrew, and Greek languages.

Looks like the characters are missing. Does the font support those characters?

Yes, sir, I have downloaded fonts from the Google Noto Fonts website.
https://www.google.com/get/noto/

Here is the screenshot for Simplified Chinese language support:
6992435--825872--chinese google noto fonts.png

Are you able to share the project or an example project that shows the problem so I can take a look?

Okay sir, give me few minutes to create a demo project because the main project already crossed 3GB storage space :slight_smile:

I have prepared a demo project for you where different Font Asset file is changing based on the language you select.
Here is the project source link:
https://drive.google.com/file/d/1PyFd2O8PD4nuNRnoWTkEyZ-4Ahbnwa6w/view?usp=sharing

Within the demo project, I have started getting this kind of error message when I was trying to build Addressables → Group for the Android platform.

Thank you @karl_jones for giving me your valuable time :slight_smile:

Are you using code stripping in the project? Can you try disabling it? It is in the project settings.

Do you mean Stack Trace?
6993005--825992--stack trace.png

If yes, then nothing gets changed.

No it’s the option here https://docs.unity3d.com/Manual/ManagedCodeStripping.html

I think by mistake you have posted wrong link :slight_smile:

Well that was embarrassing :slight_smile:
https://docs.unity3d.com/Manual/ManagedCodeStripping.html

Also could you update Addressables in the package manager to 1.17.15

I tested your project. The font you are using does not seem to support Chinese. I used this font and it worked Noto Sans Traditional Chinese - Google Fonts
Looks like your Japanese font also has missing characters

Still, on my end, the Traditional Chinese language font is not working in the demo scene.
I can’t able to see Chinese letters within the creator window - maybe there is an import settings issue!!

What do you suggest?

Even I can’t able to find Chinese letters within the font file itself.

Im not sure what you are doing to generate the atlas. I just used the dynamic mode so it generated them on demand and it worked fine.