Unity [TextMeshPRO] dynamic font display Chinese

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
insert image description here
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 insert image description here, and click on the font file we just created
insert image description here
to ensure that the icon option is Dynamic. (Dynamic)

Then we drag the file into the component, and we can enter Chinese fonts.
insert image description here
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:
insert image description here

? ? ? 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:

insert image description here
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:
insert image description here

insert image description here
Over!

Guess you like

Origin blog.csdn.net/weixin_38764837/article/details/131182668