We know that Unity's Text component has been marked as legacy in the new version, and TextMeshPRO is officially regarded as the mainstream by Unity because of its better effect.
Closer to home, if we want to use TextMeshPRO] to display Chinese, what should we do?
First of all, we must import a Chinese font
because there are many articles on static fonts, so I won’t go into details here.
Then we right-click on the font, find Create-TextMeshPro-Font Asset , and click on the font file we just created
to ensure that the icon option is Dynamic. (Dynamic)
Then we drag the file into the component, and we can enter Chinese fonts.
But! Do you think you can sit back and relax like this? NO NO NO
At this point, we copy a large section of Chinese characters to the input box, and the effect is as follows:
? ? ? What's going on, I tried to change to a different font and it's still the same, so I looked at the parameters of the font file again:
I found this thing a bit strange, and after a little thought, I understood that this font file is actually something like an atlas. If the atlas is full, dynamic generation will not be able to generate more characters, so as long as we let this atlas Larger, more characters can be displayed:
Over!