Does CCLabelBMFont support Chinese characters?

Does CCLabelBMFont support Chinese characters?
0.0 0


It seems that CCLabelBMFont is using char* and std::string, so I am not sure how to use it with Chinese characters?


why could’t use char* and std::string to show chinese characters?

CCLabelTTF can be used to show chinese characters too, you could refer to LabelTest->LabelTTFChinese


CCLabelTTF does support Chinese characters. But I tried the same way with CCLabelBMFont and failed. I think CCLabelBMFont use charid to index Chinese characters, but char(0-255) is not enough to hold all characters (0-65535).


oh, CCLabelBMFont couldn’t support chinese.
To use CCLabelBMFont, you should provide two files, fnt and png font file, and they are defined for english characters and synbols.
The characters you use are fetched from the files you provide.


I can generate fnt and png files with tools like BMFont or other font tools, and they all support Chinese character export. If CCLabelBMFont could support them it would be great.


It may be a big file, and the value of Chinese characters are different with different code format, such as utf-8, utf-16.
So it is difficult to support Chinese characters.


We can only generate the characters used, so the file will not be so big. The problem is character encoding, but cocos2d-x should support at least utf-8.