Label crash utf 32

Hello :slight_smile:

I got crash when I set string of a label with greek alphabet (abcd…) when my label string is some chinese letter.

Maybe someone has already encountered this problem?


I can ask engineering.

Please provide the version number.

Please provide a code sample to reproduce.

Thank you @slackmoehrle for your reply :slight_smile:

I remake the bug into a empty project.

It’s seem to appear when getContentScaleFactor exceeds around 4 or the font size I don’t know

I test with Noto Sans Simplified Chinese from Google Fonts

I added this line to AppDelegate to make the bug

director->setContentScaleFactor(MIN(largeResolutionSize.height / designResolutionSize.height, largeResolutionSize.width / designResolutionSize.width));

Empty project :

And what version of cocos2d-x are you using?

Sorry Yes I am using cocos2d-x-4.0

Great. I’ll ask engineering to help.

Something more interesting :

Thanks. I submitted this topic to engineering already

The crash seems to appear when there is more than 1 texture in FontAtlas using TTF

I tested in cocos2d-x-3.17.2 and everything fine

This is a problem of v4.0. It is recommended to switch cocos creator 3.x as the engine, so that you can continue to update and get better problem support in the future.

My project is very heavy. Is that possible to switch from cpp to creator without rewriting everything ? If not could you please help me finding the problem ?

The short answer is no. Creator is a rewrite of your code base

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.