-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Naive support for system fonts #21396
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
base: main
Are you sure you want to change the base?
Conversation
|
Just found #14150 as well. I'm going to address the feedback there since my implementation appears pretty similar. |
TextPlugin now includes general family face overrides
3dc0093 to
9a134a4
Compare
|
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note. Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm inclined to approve, I really like how simple the implementation is. Need to think about how it fits in with the planned font registry and other changes though.
| /// References a font inserted into the font database by family, weight, stretch, and style. | ||
| /// | ||
| /// This can include system fonts, if enabled in [`super::TextPlugin`], or previously loaded fonts via [`Font::Data`]. | ||
| Query { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though it's unlikely to be confusing to anyone, Query is so ubiquitous in Bevy that I think it's probably wise to disambiguate this a bit:
| Query { | |
| DbQuery { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting point. If it's decided we proceed on this PR, I'll update all the references for this variant.
Objective
I was working on this and noticed a superior implementation in #16365. However, I am unsure of the general consensus on loading system fonts. This PR uses the existing
Fontasset to query the system directly for fonts.Solution
Fontto include aFont::Systemvariant.TextPluginto include aload_system_fontsparameterTesting
examples/system_fontsShowcase
A font can be added with with the new
Font::Systemvariant:Note
I would love to enable System Fonts through this PR or via #16365. Please let me know what I need to do to make this possible!