Multiple same bmfont image in dynamic atlas - v2.4.3

When I created object using bmfont I realize dynamic atlas contain multiple image of that same font.

Why dynamic atlas manager keep merging the same font instead of reuse the old one? is it a bug? Thank you in advance.

I will ask engineering to have a look.

1 Like

When rendering to a texture, the Dynamic Atlas Manager will automatically detects if the texture has been merged into the atlas (Collection of images). If not, and the texture conforms to the Dynamic Atlas condition, then the texture will be merged into the atlas.

Yeah I know that. But after google around I think this issue is related to other issue about bitmap font turn to black box in cocos v2.4.3
The above image is the result of Dynamic Atlas Manager showDebug function. Maybe the picture of bmfont was destroyed accidentally, so It will merge the same picture font to the atlas.
I tried using cocos v2.4.6 and the issue is solved.

Applagies let me update this was a saterday night.

I load mine to a MySpriteSheet.plist MySpriteSheet.png ,using TexturePacker
Then in the YourBMIfonFile.fnt file in your resourse/fonts I change the text line from
file="…/YourBMIfonFile.png" , file="…/MySpriteSheet.png"

Then call like this.
auto offset=SpriteFrameCache::getInstance()->getSpriteFrameByName(“YourBMIfonFile_0.png”)->getRectInPixels().origin;
auto label = Label::createWithBMFont(“fonts/YourBMIfonFile.fnt”, “Hello World”, alignment , 0, offset);

then add the child.

The only thing I have had with its not showing correctly is if i use the Polygon settings not a bug i just can’t be botherd sort out the ammount trimming in polygon mode of TexturePacker , so i use maxrects, perfict many text all on one layer.

Im using cocos2dx V3.17.2