Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义ttf字体无效? #78

Open
RichardsATcn opened this issue Jul 14, 2020 · 3 comments
Open

自定义ttf字体无效? #78

RichardsATcn opened this issue Jul 14, 2020 · 3 comments

Comments

@RichardsATcn
Copy link

在GUI编辑器里配置好字体后,并将字体设置为导出。但是实际显示效果上字体没有变化。

UIConfig::registerFont(UIConfig::defaultFont, "fonts/DroidSansFallback.ttf");

这一句修改成我的字体后(英文数字字体),所有中文全部变特殊符号了。但是英文字体还是没应用上。

COCOS2d-x 3.17.2

@xiaoguzhu
Copy link
Member

你是单独给文本设置了字体,所以第一参数不是UIConfig::defaultFont,是你具体设置的字体名称。

@RichardsATcn
Copy link
Author

多谢大佬 还没忘记使用cocos2d 的我们

@WuJiayiSH
Copy link

用了cocos2d-lua-community的binding
我得用去掉后缀名的aliasName进行注册然后正常显示:
UIConfig:registerFont("NotoSerifCJK-Black", "NotoSerifCJK-Black.ttc")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants