Custom TTF font & letter goes missing

Hi,

I have a scene with text label which I am loading in C++ code and that is working fine.

Now when I setString like lbl->setString("1234567890"); it doesn’t render all characters. But if I specify all characters in cocos studio property they are showing fine.

My guess is that when we are updating string its not rendering properly. Noticed this issue on iOS platform (yet need to figure how to get game working on Android, as it keep crashing on launch on android).

When I used font name “Arial”, all I saw was a black box. But when I used my custom font, it worked fine the above way (i.e with in editor, but not via code).

Any clue?

Still not found any solution. I even added font on info plist as shown in sample. But same result. Tried BMFontLabel and that works fine, but my app is using 4 different language and adding BMFont is not a viable solution as it increase memory and filesize usage.

Anyone got solution?

I use TTF fonts and a TTFConfig frequently. Usually missing characters means they are not defined. All black, maybe it doesn’t find your font?

Arial works. I also use Marker Felt ok. Menlo works for me too pretty well. If I make a custom font I use Glyph Designer

Edit: But I don’t use Coco Studio.

Thanks for revert @slackmoehrle. I used Coco Studio to build my scene. I haven’t used Marker Felt or Menlo, but a different font.

I would have also suspected that missing character means those are not defined in font. But thats not the case. Because sometime it will render la m eri and some time sl ck oeh e using same font. When I created BMFont file, I also used Glyph designer and that worked fine with studio as well.

However, when using this custom TTF font in studio and typed text with in studio, it worked well 100% of time. but if I change text from code, it generate label with random missing characters.

I will give it a shot with Marker Felt and Menlo today.

devilzk, any luck solving this? I am having the same issue with a custom TTF font… in my case, it either shows the full label correctly or shows it with 3 missing chars, same 3 every time it happens… then all of a sudden it shows the full label again… no idea what’s going on…

Does your font have those characters?

Yes it does, and it worked fine for a while, even when the issue started it was happening only randomly… for now I have just changed to another font… which works fine, thanks for the help!