[cocos2d v3] Label bugs / cannot disable outline + labels cut

Hello,

I have been using Cocos2d-X V3.1 and V3.2 RC0 and have some problems with the Labels.

I am using TTF fonts so from what I understand I should be using Label::createWithTTF to create my Labels as follows :

Label* versionLabel = Label::createWithTTF("Version 1.2.3 Debug","fonts/Marker Felt.ttf" , 28);
versionLabel->setPosition( Vec2(705,145) );
versionLabel->setColor(Color3B(240,137,14));
versionLabel->setAnchorPoint(Vec2(0,0.5));
this->addChild(versionLabel);

But by doing this the fonts are slightly cut :

Here is another example with Thonburi :

I have tried using different function :

Label* versionLabel2 = Label::create("Version 1.2.3 Debug","Marker Felt" , 28);
LabelTTF* versionLabel3 = LabelTTF::create("Version 1.2.3 Debug","Marker Felt" , 28);
Label* versionLabel4 = Label::createWithSystemFont("Version 1.2.3 Debug","fonts/Marker Felt.ttf" , 28);

But by doing this I am stuck with an outline:

I have tried using on Label

versionLabel->disableEffect();
versionLabel->updateContent();

And on LabelTTF :

versionLabel3->disableShadow(true);
versionLabel3->disableStroke(true);

But this does not change anything there is still an outline or shadow on the font.
   
Is this a bug or am I doing something wrong ?

Thank you for any help.

For now I am setting aside the problem with the outline that is always visible and concentrating on the letters that are slightly cut.

I have noticed that it is more or less visible on different letters and depending on the size.

To see this I have tried out the following code with Cocos2d-X V3.2 :

char buffer[100];
float posY = 20;
for (int i = 4; i<32; i+=1) {
    sprintf(buffer,"Version 12345 aoeécçs Size %i" ,i);
    Label* versionLabel = Label::createWithTTF(buffer,"fonts/Thonburi.ttf", i);
    versionLabel->setPosition( Vec2(768,posY) );
    versionLabel->setColor(Color3B(240,137,14));
    this->addChild(versionLabel,99);            
    posY+=1.5f*i;
}

Here is the result :

It is easiest to see that the letters are sometimes slightly cut by observing the C, the left side is more or less flat depending on the font size.

On Cocos2d-X 2.1.5 here is the code :

char buffer[100];    
float posY = 20;
for (int i = 4; i<32; i+=1) {
        sprintf(buffer,"Version 12345 aoeécçs Size %i" ,i);
        CCLabelTTF* versionLabel = CCLabelTTF::create(buffer,"Thonburi" , i);
        versionLabel->setPosition( ccp(768,posY) );
        versionLabel->setColor(ccc3(240,137,14));
        this->addChild(versionLabel,99);            
        posY+=1.5f*i;
    }

And the result:

As you can see with 2.1.5 the letters are never cut but may be slightly more blurred instead, which looks much better.

Could this be something like the edges of the characters that contain alpha are cut ? This zone changes depending on the font, the size of the font and the letter that is drawn.

I have reported similar issue before. No update yet.

I opened a ticket at http://cocos2d-x.org/issues/5734.

Ok thank you

Fixed at https://github.com/cocos2d/cocos2d-x/pull/7770

Thank you this is much better.

The fix have some weird effect on other TTF fonts. There is some shifting going on for the outline

With the patch:

Before the patch: