Unity TextMeshPro Issue: Some Chinese Characters Displaying as Squares

Hello,

I’m using Unity Pro version 2022.3.14f1 and want to label certain 3D game objects with text. (The text is displayed on the 3D GameObject in 3D space, not in the UI). For this purpose, I’ve created a C# component that adds a GameObject with a TextMeshPro object.

My issue:
Generally, it works, but for some characters, instead of displaying the Chinese character, only a square is shown. (See attached image).

According to Unity’s help, I have created a TMP-Font Asset from a font (Microsoft Yahei) that supports Chinese characters (Create->TextMeshPro->FontAsset).

Inspector Settings:

  • Atlas Population Mode: Dynamic
  • Atlas Render Mode: SDFAA

When I display the same text with the font “Microsoft Yahei” in MS Word, the characters are correctly displayed. (As proof that the font can display the characters)

How can I solve this problem?

Best regards,

Matthias

Hi,
Sorry, I missed this message.
Those square characters do indeed indicate that the glyph could not be found. It could be an issue with the font or the atlas. Its hard to say without looking at the project. Is Microsoft Yahei the font you are using in the game? Does using the same game font also work in Microsoft word?
Maybe try a different font which supports Chinese and see If that works, if it does then its likely an issue with the font. https://fonts.google.com/

Hello, thank you for your message.
I have fixed the problem.
When creating the font asset I did not specify a CharacterSet and so some characters were missing and could not be displayed.
Thank you very much.