-
Notifications
You must be signed in to change notification settings - Fork 60
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
Get width of rendered text #169
Comments
It shouldn't be too hard to add something like this, a la |
noticed we don't have |
I ended up using my own text rendering system using |
I encountered quite poor performance with rusttype but probably it was due to |
I ran into a few quality issues as well, but I found that to be the font face I was using. I tested mine with Raleway, Rasa, Lora, Inconsolata and DejaVu from Google Fonts, and they all worked well. Only NotoSans didn't really work that well |
I tried both methods and found that the fontdue crate worked best in my case. The font I was using (PokemonGB) was crashing due to a negative min bounding box in the rusttype method. |
Is it possible to get a width of rendered text (i.e.
draw_text
). This particularly useful if there's a need to draw a text with mixing different colors (or perhaps there's an easier way?) so the offset for drawing a block of differently colored text is known.The text was updated successfully, but these errors were encountered: