In the drop-down window of 1.font, we can choose our favorite Chinese font. Of course, you can also download ttf fonts from third parties and import them by adding Fontfile.
2. Font coding, which means unicode by default, is a point that needs attention, which I will talk about later.
Then set the export options of fonts. There are several points to note:
The value of 1. Width and height, 4096 can be said to be the maximum, please do not exceed this value, otherwise the atlas will be too large, which will increase the number of drawcall.
2. Bit depth, I use 8 bits here. Many people may find it unclear. You can choose 32 bits, but it will also increase the burden.
All the burdens mentioned above are aimed at mobile phones.
Now let's choose the fonts we need: you can choose all the fonts you need ~ Of course, you can also choose all of them, but there are too many Chinese characters in China. It is estimated that one atlas can't fit. What should I do? Pick the words we want to use ~ don't use uncommon words. In fact, I really chose it for the first time and it took a long time. Create a txt text on the desktop, enter the text you want in it, and you can find commonly used Chinese words and paste them online. Look at the text properties: its encoding format is Chinese, GB23 12. I wonder if you remember anything.
Then save, and now return to bmfont: now find our text. Error found after selection, because the encoding format set by bmfont is different from our text! Now let's unify the coding. I use notepad++ here. Save it and try to repeat the above operation. All the words needed have been chosen. Now save what NGUI needs and get two files. Actually, I don't need such a big atlas here. I can see a big piece of black, which is wasted. We can go back to bm and reduce the width and height. Then rename the file with fnt suffix to txt.