Custom TTF failed on some android device only (3.17 & 3.15.1)

Recently I release update of my game build with v3.15.1 and luckily some YouTuber picked up and review the game.

But the videos was a bit shocking to me as the font looks horrible and I’ve been scratching my head for few days trying to resolve this issue.

To reproduce this is very simple.
Create new JS project with v3.17

Drop my custom font
FutureEx.ttf.zip (18.6 KB)
into the res folder, change the code in app.js to
var helloLabel = new cc.LabelTTF(“TEST”, “res/FutureEx.ttf”, 38);

Run cocos compile -p android --android --app-abi x86
To generate the apk

On my own device and one android emulator (Nexus 10 with API 24 - Graphics setting = Software - GLES 2.0) works totally fine.

On different android emulator (Nexus 5X with API 26 - Graphics setting = Automatic ← this option is locked) looks like this.

Anyone has work around for this problem?
My suspicion is todo with rendering on higher version of Android device

Can you provide the APK? This seems weird because I usually use custom font, TTF and BitmapFont also, never met this problem

Are you laying anything out based upon screen size and quality? Perhaps these devices that are failing have a unique screen size, or something?

https://drive.google.com/open?id=1zKAjj8lLzfHdACV-L5Sr1Lv4rlgEtf7i

Above is the link of the apk

It will failed on the below setting for me

Create new Virtual device under AVD Manager with below setting should do the trick.


I was digging yesterday and see there are new settings for TTF under Oreo so maybe this is todo with the API version as well

No, please see the screen shot.
Don’t believe its a layout issue, I guess its more todo with some android version issue.

Its not ideal but ok to see the custom font turn into the default system font.
The biggest problem is if this happen, the default font display with top pixel cut off.
As if the font is still using the bonding box of the custom font. (see screen shot 2 on the original message)

Some TTF fonts have trouble with Oreo. Try convert your font with https://everythingfonts.com/font-face and use the returned TTF file as replacement!

1 Like

Interesting idea! I hadn’t thought about that nor did I realize there was an Oreo issue.

Thanks it works now.
Wouldn’t thought it is an font vs Oreo issue since that font has been working for the past 2 years.