Search Unity

  1. Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. Dismiss Notice

Correct Way to create a general purpose TextMesh Pro Asset for non-English Languages

Discussion in 'UGUI & TextMesh Pro' started by Sherwinnie, Jan 2, 2021.

  1. Sherwinnie


    Jan 24, 2020
    I have been trying to create a general Purpose TextMesh Pro Asset for Japanese and Chinese for a while now. By general purpose, I mean an asset that holds most of the characters of the language, so we do not have to create many different small assets, rather a big one that can be used by nearly every text in game.

    However, I have little to no success so far. Here was my attempt:
    Screen Shot 2021-01-03 at 2.45.20 AM.png
    The above is currently the result. The left one is the Native Text from Unity, and the right one is the one created by textmesh pro. As you can see, the right one is obviously more blurry.

    I have discovered that it is just impossible to get a good render in just one Asset for languages with many characters (5000ish for Japanese, for example), even if we set the texture size to 2048x2048, the biggest amount that mobile devices can handle. So my attempt is to create several different smaller assets, and combine them via the fallback system, like this:

    Screen Shot 2021-01-03 at 2.45.36 AM.png

    So, currently, I have 8 2048x2048 assets, each holding about 500ish characters. That is almost 80mb in file size. However, even with this, the result is still blurry when the text is enlarged (like the one I show above). I have found it is really hard to use TextMesh Pro for different languages, especially for localization. I just want to make sure, am I doing something wrong? Is there a more optimal way for this purpose?

    ps. here's the one of the Face Info of the assets. The rest looks about the same, too. Screen Shot 2021-01-03 at 2.45.40 AM.png

    Thank you!

    Attached Files:

  2. Stephan_B


    Unity Technologies

    Feb 26, 2017
    The font asset does not appear to be an SDF font asset. Please consider creating a font asset using the SDFAA mode or any of the other SDF modes. This will make the text render correctly at any point size and scale.

    Since the introduction of Dynamic Font Assets and Multi Atlas Textures, it is no longer necessary nor recommended to create multiple static font assets to try to handle all potential characters for various source font files and languages.

    The new recommended workflow is to use static font assets that only contain the known characters used in the project for any given language or groups of languages and to then rely on dynamic font assets (with multi atlas texture enabled) assigned as fallback to handle all other potential characters contained in their source font files.

    By known characters, I mean all the characters contained in your UI, Menus, Dialogues, etc. IE. all the text known at build time. Anything else coming from user input will be handled by the dynamic font assets / fallbacks.

    Multi Atlas Texture enables a dynamic font asset to create new atlas textures as needed to handle requested characters and glyphs. This feature makes it possible for a dynamic font asset to handle every single character contained in the source font file.

    Please take a look at the following two videos which cover most of this information.

    Sherwinnie likes this.
  3. Sherwinnie


    Jan 24, 2020
    This is so very helpful! I wished I have seen these earlier. Kind of surprised that no one has translated these videos and processes into other languages, too. Maybe I will do that in the future!
    Last edited: Jan 3, 2021