Apparently is is possible to use Cocos2d-js 3.0 RC3 cc.LabelTTF
with custom fonts, for example as answered here. However this doesn't seem to produce any results for me, neither in the local JSBinding app nor in the web browser.
Font file was included in the res
object:
var res = {
lobster_ttf: "res/Lobster.ttf"
};
var g_resources = [];
for (var i in res) {
g_resources.push(res[i]);
}
Lobster.ttf
does exist in the directory res
.
The label is instantiated as follows:
var label = new cc.LabelTTF("labeltext", res.lobster_ttf, 48);
Doing this will not display the label in the specified font but in the default font. Specifying an installed font instead of the path to the custom ttf does however work.
Is there extra work required to be able to use TTF files?