Hello everyone,
I’m reaching out to share a technical issue I’ve encountered in Cocos2d-x v4, specifically related to text rendering in Asian languages like Japanese, Korean, and Chinese.
Problem Description:
When displaying large amounts of text in these languages, I’ve noticed that parts of the text are missing in the game. This issue seems to be particularly evident when new pages are generated in the FontAtlas
. Interestingly, this problem did not occur in Cocos2d-x version 3, even with pagination.
Context and Details:
- Affected Languages: Japanese, Korean, Chinese.
- Specific Situation: The issue arises when loading and displaying large text blocks.
-
Observations: The problem seems tied to the
FontAtlas
generating new pages for more characters. However, upon inspecting the generated textures forFontAtlas
, I didn’t observe any empty spaces, implying that the textures are being assembled correctly.
Hypothesis:
The issue might be related to how FontAtlas
in Cocos2d-x v4 handles the creation of new pages, which is different from v3. Increasing CacheTextureWidth
and CacheTextureHeight
to avoid pagination seems to mitigate the issue, suggesting that it’s specifically related to new page handling in the texture atlas.
Attempted Solutions:
- I tried different sizes and configurations for
FontAtlas
, but the issue persists. - I confirmed that it’s not a memory or device capacity issue.
- Increasing
CacheTextureWidth
andCacheTextureHeight
to avoid pagination helps, but this is not a viable solution for all scenarios.
Request for Help:
Has anyone else experienced this issue in Cocos2d-x v4, and do you have any solutions or suggestions? Any advice on efficiently managing FontAtlas
with large character sets would be greatly appreciated.
Additional Information:
- Cocos2d-x Version: 4 (issue not present in version 3)
- Tested Platforms: iOS, MacOs
Thanks in advance for any insights or assistance.