-
Notifications
You must be signed in to change notification settings - Fork 510
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
Picographics: wordwrap ignored for vector fonts #521
Comments
Same issue - did it get resolved? |
@netsmith unsure, a whole bunch of life got in the way and distracted me since I posted this and I haven’t revisited the project I was working on at the time. If you’re still seeing it with the current release then I guess it hasn’t been addressed yet. To be fair it can be a complex problem to solve with non-raster fonts as their width is hard to predict when you account for kerning and the variability of individual glyphs so I’m not surprised if it’s been left in the ‘too hard’ bucket for the time being 😛 With raster fonts you can just multiply the fixed width by the number of characters to know when you’ll hit the edge of the drawing area and will need to wrap. With vector fonts you have to query each glyph’s individual width at the given scale, and calculate the kerning that the font defines (if any, these ones might not) and apply that to the tally. |
Pretty much exactly what @anomaly256 said. It's a big effort for little return. I'm actually someday hoping to replace all of our vector fonts with a polygon renderer and "Alright Fonts" - https://github.com/lowfatcode/alright-fonts Made the first step for that here, but there's a way to go - #783 |
I've noticed something else: Line breaks don't work with vector fonts either. They only work with bitmap fonts. |
@anomaly256 Measurement of text width appears to work correctly when it comes to centralizing text, so it seems like that aspect is already solved perhaps? |
Hi, I've noticed today that passing a wordwrap value though .text() is ignored when using a vector font. Is this expected behaviour? Documentation doesn't mention that it is.
Thanks
The text was updated successfully, but these errors were encountered: