Online about cocos2d engine font use of the tutorial can be said to be flying everywhere I don't say, this article mainly explains how to use third-party. TTF fonts.
Cocos2d-js Web and JSB version, first of all to explain how the Web version using the third-party Xxxx.ttf font, you need to load fonts in resource, the format is as follows:
var g_resource = [
.... omitted here Other
{
Type: "Font",
Name: "Arial Bold",
srcs:["Resource/font/arialbd.eot", "Resource/font/arialbd.ttf"]
Arialbd.eot, Arialbd.ttf , the name ARIALBD Casual. (This is relative to the web version, // but n Ame must be the name of the font library)
}
];
Then use the "Arial Bold" font name directly,
For example: var labTest = new CC. Labelttf ("12345", "Arial Bold", 25);
Now tell JSB how to use: In the JSB do not need so much trouble, you can use directly: for example
var labTest = new CC. Labelttf ("12345", "resource/font/Arial Bold. TTF ", +);
But here you need to pay attention to Arial Bold. TTF font name, this name must be the name of the font library. Special and web versions of
Arialbd.ttf apart.
Cocos2d-js TTF Font Summary (the most detailed tutorial in history).