cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.18k stars 1.93k forks source link

WeChat mini-game platform sets the font to be invalid #16799

Open smallmain opened 7 months ago

smallmain commented 7 months ago

Cocos Creator version

3.8.2

System information

MacOS

Issue description

1.Create a new project, create a new Label, and use the font Siyuan Songti. 2.Publish to the WeChat mini game platform and run on real IOS devices. 3.Invalid custom font.

This problem can only appear in non-high performance mode, or high performance mode +。 The cause of the problem is that the font family of some fonts has spaces. Just use something like ${fontSize}px "${fontFamily}" and there will be no problem in splicing.

Relevant error log output

No response

Steps to reproduce

.

Minimal reproduction project

No response

minggo commented 7 months ago

Does WeChat support this font?

smallmain commented 7 months ago

Does WeChat support this font?

I tried modifying the family name of the same font by fonteditor (removing the spaces), and it rendered normally. The problem is that font names with spaces on the WeChat mini game platform need to be wrapped with "", but the engine does not handle it correctly.

minggo commented 7 months ago

Got it, thanks.