Saturday, October 1, 2022
HomeGame DevelopmentThe way to cache RichText font in Cocos Creator 3.5.0 - Cocos...

The way to cache RichText font in Cocos Creator 3.5.0 – Cocos Creator


I attempted to make use of RichText part and use my very own font (not system font). The fonts are OK and accurately loaded after I run it on browser for debugging.

However the issue is that after I run it on the android machine, the font is just not loaded and it use Arial as a substitute.

Is there any solution to remedy it? I keep in mind that now we have Cache in Label part, however I couldn’t discovered it on RichText.

I’m making a recreation for Android machine utilizing Cocos Creator 3.5.0


Verify if the font-family and font-name of ttf fonts are the identical.

The Font-Household property is just not out there on the RichText in 3.5.0

Are you able to present the font you’re utilizing now?

It’s exhibiting on my screenshot above.
Font is Silkscreen-Common.ttf

Are you able to give me your font for check?

you’ll be able to obtain it right here: https://fonts.google.com/obtain?household=Silkscreen

Anyway, it occur on all fonts that I attempted. Even Calibri…


The font-family and font-name should not the identical. You need to use this instrument to alter the font:FontCreator for Home windows – the preferred font editor

I’ve tried it:

Nonetheless no luck, the font nonetheless not loaded.

right here is the font

i’ve check with the font you give, all works nicely, right here is my demo:
57256.zip (38.9 KB)
and right here is screenshot in my cellphone, my cellphone is huaweiP30Pro

it’s RichText, not Label part, proper?

i don’t know why it’s nonetheless not engaged on mine:

It work if i exploit Label, nevertheless it doesn’t work in RichText

I attempted to log the Font and FontFamily of the RichText:

D/jswrapper: JS: Popup_Manager::show_credits() Font GUI =  property/important/native/2a/2a613d4e-f148-4a8b-9cc7-e07a5ff8f58f/Silkscreen.ttf
2022-10-01 02:10:06.982 13860-13903/com.juarasatu.muscleman
D/jswrapper: JS: Popup_Manager::show_credits() FontFamily GUI =  Arial

By default even after I take advantage of the font file it all the time have ARIAL because the Font-Household. And that i although if I manually change it to Silkscreen it’ll work. However seems it doesn’t.

RichText.FontFamily = "Silkcreen";

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments