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

refine font setting both in Label and RichText component #5490

Closed
wants to merge 1 commit into from

Conversation

PPpro
Copy link
Contributor

@PPpro PPpro commented Sep 30, 2019

Re: https://github.com/cocos-creator/2d-tasks/issues/1699

changeLog:

  • 优化 Label 和 RichText 的字体设置操作,禁止不设置自定义字体也不使用系统字体

test

@jareguo
Copy link
Contributor

jareguo commented Sep 30, 2019

我记得现在不设置的话,默认好像就是用 Arial 渲染的。为什么要强制用户必须设置一个 font family 呢?

@PPpro
Copy link
Contributor Author

PPpro commented Oct 1, 2019

我记得现在不设置的话,默认好像就是用 Arial 渲染的。为什么要强制用户必须设置一个 font family 呢?

那就是默认使用 Arial 系统字体,没有冲突
现在的设计就是这样,如果不使用自定义的 font,至少必须得使用系统字体

以前编辑器上的操作是,可以不设置 font,也不设置系统字体(这时候编辑器就不渲染 label 了)
但是运行时还是默认使用 Arial 字体渲染,这就导致了编辑器和运行时的行为不一致

@holycanvas
Copy link
Contributor

我的想法是,系统字体和自定义字体本身是互斥的,所以系统字体和自定义字体的设置框应该根据use system font的checked与否动态显示。如果用户不设置自定义字体,就默认使用arial,输入框空着感觉也没什么问题呀

@jareguo
Copy link
Contributor

jareguo commented Oct 11, 2019

但是运行时还是默认使用 Arial 字体渲染,这就导致了编辑器和运行时的行为不一致

嗯,确实应该行为一致

如果用户不设置自定义字体,就默认使用arial,输入框空着感觉也没什么问题呀

同意

@cocos-robot cocos-robot changed the base branch from v2.2.1 to v2.2.2 October 21, 2019 11:21
Copy link
Contributor

@cocos-robot cocos-robot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@umbrellaPP, v2.2.1 branch will be deleted, so we edited the base branch to v2.2.2, or this PR will be killed by GitHub.
Please review the commits history to ensure that the PR does not polluted by unneeded commits from your origin branch.
If you need to merge to other branch, you can first click the Edit button on the right side of the PR title, then switch the base branch.
If necessary, welcome to resubmit a new PR. Thanks!

@PPpro PPpro mentioned this pull request Oct 27, 2019
@PPpro PPpro closed this Oct 27, 2019
@PPpro PPpro deleted the 220_font branch November 28, 2019 05:08
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

Successfully merging this pull request may close these issues.

None yet

4 participants