Open asnagni opened 1 month ago
After more investigations, to ensure emoji support, I included a font that supports emojis along with Nunito. I used a fallback font for emojis such as "Apple Color Emoji" on iOS or "Noto Color Emoji" on Android. I’m not sure if this work around is the right way to go to have to work.
For the EditBox on iOS:
editBox->setFont("Nunito-Regular.ttf,Apple Color Emoji", 42);
the font "Nunito-Regular.ttf,Apple Color Emoji" is integrated in the iOS device no need to download anything.
For the EditBox on Android:
editBox->setFont("Nunito-Regular.ttf,NotoColorEmoji.ttf”, 42);
For Android some devices may not have it installed by default so you may want to download and install it.
I still don’t know why is the difference between cocos2d-x and Axmol. But at least there is a workaround. What do you think? Is there a better way?
@asnagni Please clarify one thing, when using Nunito-Regular.ttf
with Cocos2d-x, did it render the emojis correctly? Specifically, when using code like this:
editBox->setFont("Nunito-Regular.ttf", 42);
Also, if it did show emojis, then which version of Cocos2d-x are you referring to?
Description:
We are experiencing an issue with displaying emojis and emoticons in our application built with the Axmol engine. When we use our custom system font (Nunito), emojis and emoticons do not render correctly; instead, they appear as squares. This issue does not occur when we switch to the Arial font, where emojis and emoticons display as expected.
Steps to Reproduce:
Expected Behavior:
Emojis and emoticons should render correctly when using the Nunito font, similar to how they do when using the Arial font.
Actual Behavior:
Emojis and emoticons appear as squares when using the Nunito font.
Additional Information:
Font: Nunito Engine: Axmol Comparison: Emojis and emoticons render correctly with the Arial font. Questions:
Are there specific configurations or additional steps required in Axmol for supporting emojis and emoticons with custom fonts? Is there a known compatibility issue between Axmol and the Nunito font regarding emoji rendering? Attachments:
Text project: HelloCpp.zip
Thank you for your assistance.