BUG? - Issue with new label generating corrupt looking characters / incorrect kerning...

Hi,

Seem to of encountered the new label generating corrupt characters from otf fonts i have used also you will notice incorrect kerning for example on the letter y in this example…


problem.jpg (165.9 KB)

hello, can u send me a demo code or put it on gihub share me the link .

I can try to fix u problem

I have attached 2 fonts that exhibit similar symptoms and some sample code of how I’m using the label below…

Label *pLabel = Label::createWithTTF(“Melody town, a town of sound, where beautiful music,”, “fonts/ScriptLite.otf”, 52);
pLabel~~>setAnchorPoint;
pLabel~~>setPosition(Point(50,50));
pLabel~~>setColor);
this~~>addChild(pLabel);

should be fairly simple to quickly test, but if you need me to create a test project let me know. Thanks.

I’m test u code in 3.0alpha1 version . I think it is perfect runing in my project.

Can u sent me u project or u can create a new project with 3.0 alpha1 test it and compare with u current project.

good luck for u

and here it is my email address , u can send me email directly
yuye.liu@chukong-inc.com

Peter Tribe wrote:

I have attached 2 fonts that exhibit similar symptoms and some sample code of how I’m using the label below…
>
Label *pLabel = Label::createWithTTF(“Melody town, a town of sound, where beautiful music,”, “fonts/ScriptLite.otf”, 52);
pLabel~~>setAnchorPoint;
pLabel~~>setPosition(Point(50,50));
pLabel~~>setColor);
this~~>addChild(pLabel);
>
should be fairly simple to quickly test, but if you need me to create a test project let me know. Thanks.

Ive been using the latest version from github, i managed to fix the corrupted character by editing my font and removing the notdef character. Not sure why cocos was trying to render it as part of the a’s and ,’s. However you will notice in the alpha version it still has the wrong kerning for the y and f as those letters should be closer to the preceding characters.

Just as a update the latest beta 3.0 still has the kerning bug as per yuye’s screenshot above.

Thanks peter.

Could you open a ticket with the steps to reproduce the bug ?
(Attaching the ScriptLite.otf file too).

Thanks!

Thanks, ticket created… http://cocos2d-x.org/issues/3678

@Peter Tribe
I fixed the incorrect spacing between characters at:https://github.com/cocos2d/cocos2d-x/pull/5105.

WenHai Lin wrote:

@Peter Tribe
I fixed the incorrect spacing between characters at:https://github.com/cocos2d/cocos2d-x/pull/5105.

Great, working now thanks, how ever i have found a similar issue with distance field being enabled…

See http://www.cocos2d-x.org/issues/3758 for more details.