Label BMFont contains a strange space in a last character

Hi guys,
I use ```Label::createWithBMFont(“font.fnt”, “1000000”);```` to create a label. But when it’s showing, I realize that a strange space appears in the string as an image below:

I don’t know how to attach my font here, so I upload it to that link: Gofile - Free file sharing and storage platform

I’m using cocos2d-x cpp version 3.17

Does anyone meet this issue before? Please give me some advice on it.

Thank you!

I can reproduce this, but only with your font files, in both cocos2d-x v3.17.2 and v4.

How did you generate the bitmap font file?

I used ShoeBox to create it for a long time ago. But after updating to macOS Catalina, I cannot use that ShoeBox anymore, so I cannot show a step by step as you want.
Is there any way to debug my issue?

Thanks!

If you have a Windows PC or virtual machine (like with VirtualBox), then you can still run ShoeBox.

As for debugging, sure, you have access to the full source code, so load up the debugger and step through the source. It happens on any value you pass to the label, so just use a value like 100 to simplify things a bit. The last character always has that strange space, so you should be able to track down why it happens.

Thanks for your suggestion. I will try to debug it.

I also realize that this bug only happens when I use the font with “kernings count” != 0
Do you have any suggestion for it?
Thanks!

You should upgrade Adobe Air to the latest version, I’m using Shoebox on Catalina 10.15.4

Well, there you go, you’ve found a possible clue as to the cause. It may have something to do with the code that handles the kerning, and it makes sense to check that section of code too since the bug is related to the space between characters.