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

Add built-in font(s) #1017

Closed
visualcode-t opened this issue Dec 6, 2020 · 6 comments
Closed

Add built-in font(s) #1017

visualcode-t opened this issue Dec 6, 2020 · 6 comments
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@visualcode-t
Copy link

What problem does this solve or what need does it fill?

It would be nice if we were able to have at least one built-in font. Even better if we had the option to fall-back to this default when a font is unable to be found.

Describe the solution would you like?

Add support for one or more common fonts. Optionally allow setting of a "fall-back" font to an item when the expected font is not found.

@Moxinilian Moxinilian added C-Feature A new feature, making something new possible A-UI Graphical user interfaces, styles, layouts, and widgets labels Dec 7, 2020
@rparrett
Copy link
Contributor

@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed C-Feature A new feature, making something new possible labels Mar 21, 2022
@nicopap
Copy link
Contributor

nicopap commented Jun 5, 2022

For https://github.com/nicopap/bevy-debug-text-overlay/ I made a special font derived from Adobe Pro (SIL) with only the ASCII range. You can get very small file sizes with this trick.

What would be ideal thought for a font is something with a C00 or public domain license. Then our users wouldn't have to worry about licensing issues, even in the case where the font is just really meant to be used in dev and not distributed with the final binary.

@mockersf
Copy link
Member

mockersf commented Jun 5, 2022

I would really prefer to support defaulting to a system font (#1325) than using a limited to ascii font

@nicopap
Copy link
Contributor

nicopap commented Jun 6, 2022

@mockersf Though with this approach, you wouldn't be able to use the system fonts on web target. I think a (feature-flag disableable) built-in font for debugging purpose is still useful, even considering access to system fonts.

@mockersf
Copy link
Member

mockersf commented Jun 6, 2022

I haven't looked into it at all, but shouldn't it be possible to load fronts from the browser on web target?

@bjorn3
Copy link
Contributor

bjorn3 commented Jun 6, 2022

I think that would require drawing every character to a canvas in the size as you want to use them and then get bitmaps from the canvas. That would lose character sizes, kerning information and ligatures (essential for arabic) though. You could also draw the full text to a canvas and then create a single texture for it.

@Weibye Weibye added this to UI Jul 31, 2022
@Weibye Weibye moved this to Todo in UI Jul 31, 2022
@nicopap nicopap closed this as completed Apr 23, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in UI Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

7 participants