Friday, May 3, 2024
HomeGame DevelopmentLearn how to cache RichText font in Cocos Creator 3.5.0 - Cocos...

Learn how to cache RichText font in Cocos Creator 3.5.0 – Cocos Creator


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

However the issue is that once I run it on the android machine, the font shouldn’t be loaded and it use Arial as an alternative.

Is there any technique to clear up it? I do not forget that we have now Cache in Label element, however I couldn’t discovered it on RichText.

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


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

The Font-Household property shouldn’t be accessible 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 take a look at?

you possibly can 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 aren’t the identical. You need to use this instrument to vary 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 take a look at with the font you give, all works effectively, 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 element, proper?

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

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

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments