-
Notifications
You must be signed in to change notification settings - Fork 418
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
Integrate gfx_glyph #132
Comments
It would be nice, yes! Glyph caching is on the to-do list anyway; I've been looking at gfx_glyph as a way of doing this but haven't really tried it out. |
Looks okay but there's a few rough edges. The main ones:
|
I have cross posted the second issue. I'm not sure about the solution of the other two, so I will leave it for further discussion. |
@icefoxen regarding your first rough edge; gfx_glyph takes Let me know if you find more annoyances with gfx_glyph. |
So I've been tinkering with this (not everything is on my public fork), and ran into
So far, I see these approaches on how to marry the two:
Both will require some sort of font handle to be stored within After naively implementing the first one (it lacks the drawing part, and screws up API by requiring |
@Ratysz Hey, thanks for the great summary! I'll play with the code you linked. One thing is sure, this will almost certainly need changes to the text drawing API to take full advantage of What I was originally thinking of is your first option, since I thought the glyph cache was only cleared upon demand. Turns out this is not true, it basically gets cleared whenever you change what text you're drawing. It actually looks like adding an option to only clear the cache explicitly would actually be really easy, if we ever need it. Digging around into its guts a little it looks like there's a few layers to this. It looks like So what it looks like is that we can do something like the first option and it will probably work okay; we basically use Of course, the real answer is "try things out and benchmark". That ought to be interesting! Also, having multiple Now pondering the second option... it would essentially come down to having a separate (Also, SO Assuming this all makes sense, how to move forward:
|
Yeah that's about right but I never miss an opportunity to explain it with boring verbosity; there are 3 kinds of caching layout, texture and draw.
|
I tinkered some more, this time putting a centralized Implemented a new
If/when alexheretic/glyph-brush#24 happens, it should be possible to omit the ungainly |
Ratysz's PR has been merged, and it's pretty slick. The API looks okay, we'll leave it as it is for now and play around with it, and see if there's anything we want to change or that needs fixing. In 0.5.0 it should become the main API. |
Pulled a bunch of the
We need an API where we can:
|
Random pondering:
|
Figured it out. Also, bitmap fonts should be entirely separate from this and part of their own crate, since they can just be implemented using |
A lot of little shuffling and refactoring of API, which will probably go on for a while. There's like a million TODO's and such. Still, very nice all in all. Closes #132.
DONE IN 2ae4841 🎉 🎉 🎉 |
@icefoxen Regarding this, I'm getting the following when running the hello_world example:
|
Yeah that's because I'm in the middle of tearing apart and redoing a bunch of drawing stuff... ...or because I did something dumb. Are you working off of 2ae4841 or a later version? |
Alright, I was on e056397 which had the change to draw function using the non-reference version of D |
Yeah, if I was smart I would have made that stuff part of its own branch; I'm not used to people being interested enough to track |
No problem, thanks for helping figure out what was happening and all the work you're doing. Excited to see the SDL dependency removed |
It's a high quality text rendering library with line breaking handling, which should be better than the current codebase.
The text was updated successfully, but these errors were encountered: