Assistance Needed with Font Compatibility in TextMeshPro for Multiple Languages

Hi there,

I am displaying Chinese, Japanese, and other languages in my project. I have entire text files that will appear as pages, and I need to write a method to determine if a given font can render the characters in TextMeshPro. These characters will come from a text file.

I tried an approach, but it didn’t work because TextMeshPro dynamically updates the character lookup. Could you please advise on how to achieve this?

  foreach (char c in text)
            {
                if (!fontAsset.characterLookupTable.ContainsKey(c))
                {
                    unavailable.Add(c);
                }
            }

            if (unavailable.Count > 0)
            {
                Debug.Log($"Unavailable: {string.Join(",", unavailable)}");
            }

            return unavailable.Count == 0;

Thank you,

Hi,
I’ll move this thread to the text section as it’s better suited there.
One thing to try is generating a character set and using that to generate the font atlas.
https://docs.unity3d.com/Packages/com.unity.localization@1.5/manual/StringTables.html

1 Like