CCLabelTTF kerning not working properly

I’m printing a text in my game using CCLabelTTF with a font name “ThinLinesandCurves.ttf”. The designer is using the same font on adobe flash. The problem is that when the text is drawn using cocos2dx I get a different result than what the designer gives me on adobe flash.

Does it mean that kerning doesn’t work on cocos2dx 2.2? but the documentations says that it does. Anyone got a similar problem?

I’ve uploaded two pictures showing the difference between cocos2dx and adobe flash. The kerning is clear when you look at the space between the letters “W” and “O”.


Screen Shot 2014-01-31 at 1.34.45 PM.png (7.3 KB)


Screen Shot 2014-01-31 at 1.35.19 PM.png (7.7 KB)

Hi Karim,

I faced same issue with fonts, for my problem i figured that CCImage class had some glitch so, I changed that.
If your problem is same as mine,this Link may help you to understand what I am saying.

https://github.com/cocos2d/cocos2d-x/pull/2873

Thanks,
Vinit

Hey Vinit,

I looked at the issue that you had and it’s not the same. My issue have to do with kerning. It seems they got it fixed for v3.0 but not v2.2. Here is a link to the fix https://github.com/cocos2d/cocos2d-x/pull/5105 and that’s the link for the corrected mistake https://github.com/Dhilan007/cocos2d-x/commit/2bd1de91c3a33f780ab51236991b8da3f026e8dd. But then again these files (CCFontAtlas.cpp, CCFontDefinition.cpp and CCFontFreeType.cpp) are only available in v3.0. Is there a way where I can do the same fixes of 3.0 onto 2.2 since the whole code is open source?

Thanks :slight_smile: