Unity Chinese becomes a box/does not display

Unity Chinese becomes a box/does not display

Simple, but don't know it.
base on:
"unity TextMeshPro Chinese display settings"
(this article introduces how to use Font Asset Creator, the link provided by the blogger at the bottom contains font files, generated asset files, etc. I used the zh-cn_Commonly_Used file, which contains commonly used Chinese characters)

"Unity gets free commercial Chinese pixel fonts"
(I downloaded the fonts from the link provided by the author in this article)

//There should be another article here, which explains in detail the content of each setting in Font Asset Creator, which is very helpful to me, but I can't find it. After I found it, I changed it to "Create TextMeshPro Chinese
fonts in Unity (including common Chinese characters TXT file)"
good news, found

After reading the above two blogs and following them, □ still appeared in the dialog box, the following is my solution process

View Inspector

At this point, there should be a generated font file (blue F logo), select the font file, and pull it down in the Inspector (checker), you should see the character table option.
Inspector
There are only 103 characters in this Character Table, that's why boxes always appear in my dialog, the character table doesn't cover the words in the dialog. Click to expand, you can see what the characters inside look like.
Characters

Use Font Asset Creator again

Because I didn't care about anything and directly generated it by default, it led to today's tragedy. Open Font Asset Creator, this time you need to change some settings when generating.
There are three main places where problem-solving changes are addressed:

insert image description here
①Sampling Point Size Sampling Point Size: The larger the number, the more it looks like a glyph. (The following is what I saw from other people's blogs.) This value is preferably between 50-70. If it is too large, some characters may not be sampled.

sample point size=6 (the default seems to be this):
Please add a picture description

sample point size=50:
Please add a picture description

②Atlas Resolution resolution: It will also affect the number of words that can be sampled. Once, because the resolution setting was too small, only the hollow part of the text was displayed, and my dialog box became blank although there was no box.

512 * 512:
Please add a picture description
4096 * 4096
Please add a picture description

③Select Font Asset and Custom Character List
After changing the above two settings, most of the commonly used Chinese characters can be successfully used. However, there are still some less commonly used words in the copy that are displayed in boxes. At this time, select Customer Characters for Character Set, drag in the generated font, and manually enter the specific words in your own copy in the Customer Character List.
Using Customer Characters to improve the Font Asset should be able to display a lot of text in this asset, which is basically enough for copywriting, only need to add some special text, hand typing is an acceptable workload for me. Note that regenerating and saving at this time will overwrite the previous asset. If the List contains only new words, then only those words will be added after saving. If the font asset is generated for the first time or there are few characters supported in the font asset, you should still select Character from file, and then import the common word txt file.

The generation is successful, and you can use it when you see that the character table in the inspector is almost the same as the number of characters in the txt you selected.
Please add a picture description

Guess you like

Origin blog.csdn.net/oliviaher/article/details/129292643