[SOLVED] cc.LabelBMFont

[SOLVED] cc.LabelBMFont
0.0 0


I am tryin gto use cc.LabelBMFont but I am getting this error in Chrome when debugging.

cc.BMFontConfiguration._parseConfigFile)(: Error parsing FNTfile res/fonts/bitmapFontTest5.fnt CCCommon.js:145
cc.LabelBMFont.initWithString(): Impossible to create font. Please check file

I have copied the fnt and png files directly from the cocos2d example code and this is how im trying to use it.

    var label;
    label = cc.LabelBMFont.create("Test", "res/fonts/bitmapFontTest5.fnt" );
    this.addChild(label, 0, 100);



This message means that your fnt file have problem, so maybe fix it and try again


he did say he just copied the fnt file from the samples, so that shouldn’t be the problem?

have you checked the route/path to the .fnt and the file name?

Offtopic: there seems to be a typo in that error message, I’ll fix it now.



The paths etc are all fine for the resource files. It just does not like them. Thing is they work in the sample.


OK, I have had some progress with this.

I am now running my app on the mac in chrome using simpleHTTPServer and it all seems to be working.

On my windows 8 box I have setup iis with the app running from the windows web server and it does not work. I am wondering if there are security issues going on with certain files I am trying to load.


Do any errors pop up in the browser’s console in windows?


I decide to kill IIS and use apache and all working ok now.