Get data from file "myfont.fnt" failed!

Hi,

I have a tests projects that works pretty well. I load sprites and move them on the screen. Now I’m trying to render a bitmapfont but it does not work… I get an “Get data from file”myfont.fnt" failed!" error. It shouldn’t be so difficult don’t you think? I’m using this code to load the font. The fnt and its png have been generated from heiro.

@
CCLabelBMFont *bitmapFont = CCLabelBMFont::create(“HELLO WORLD”,
“myfont.fnt”,
kCCLabelAutomaticWidth,
CCTextAlignment::kCCTextAlignmentLeft, CCPointZero);

this->addChild(bitmapFont);@

Any idea? :frowning:

JB
@jboschaiguade

What’s the path of “myfont.fnt”?

It is in the Resources folder, with all other assets. Should it be some other place?

What platform did you test?

oh sorry, I’m in WIN32. I like Visual Studio for learning faster :slight_smile:

this might be a bug, the same code works perfectly on iPhone. I’m using the cocos2d-2.0-rc2-x-2.0.1 version

Should I create an issue?

I have tested it. But this issue can’t be reproduced.
I used bitmapFontTest3.fnt and bitmapFontTest3.png in tests/Resources folder.
Make sure that you got two files(myfont.fnt, myfont.png) in your resources folder.

James Chen wrote:

I have tested it. But this issue can’t be reproduced.
I used bitmapFontTest3.fnt and bitmapFontTest3.png in tests/Resources folder.
Make sure that you got two files(myfont.fnt, myfont.png) in your resources folder.

are you using this version? cocos2d-2.0-rc2-x-2.0.1 version

I tried with the tests folder fnt and didnt work as well. It is strange since the exact same code works in mac and not in win32. The file is there… 100% sure…