-
Notifications
You must be signed in to change notification settings - Fork 77
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 font support #581
Add font support #581
Conversation
Would it be possible for font's to implement Clone? I ask because I hit a blocker while porting Mergui. Mergui used to take an piece of text that was already rendered for the components that dealt with text. With the changes it feels like Mergui should also stop working with pre-rendered pieces of text. This means that every widget needs some way to get a mutable reference to the correct font. The easiest (and in my eyes, most logical) way is to add a Font field to Mergui's widgets. However, this isn't really an option as there is no easy way to get multiple copies of a Font. (Only way I can think of is by loading the font for every widget) |
@lenscas Would it not be possible to throw the font in an |
I guess it would, it makes the interface a bit uglier (As the user would need to wrap every font into that) so I am still a fan of having this tucked away into Font itself (or have it have some other way to be cloneable) but as it isn't really needed for quicksilver I can see why it isn't. |
It can be useful to lay things out without drawing them, e.g. querying the total size of a region of rendered text.
It's replaced by the font's draw method
This reduces the complexity of the callback and also allows for creating new cache pages
Now, if a word won't fit on an old cache page, a new one will be created.
This change adds a new Font API to version 0.4, using glyph caching rather than rendering entire strings at once as in the 0.3 API. Because the new API relies less directly on rusttype, it can also support bitmap fonts.
Motivation and Context
See #552
Checks
- [ ] Add a way to create / load bitmap fonts(Delayed for a future change)draw_text
CHANGES.md
, with [BREAKING] next to all breaking changes