Closed tigregalis closed 3 years ago
It seems ttf-parser is returning a zero bounding box for this glyph. The rasterizer fails as it can't draw the outline within the incorrect bounds. I've raised an issue upstream: https://github.com/RazrFalcon/ttf-parser/issues/49
As I'm not 100% sure if this will be fixed upstream, I'll queue up a workaround fix in the meantime (#30).
So this should be fixed in the next release that I'll publish at the end of the week.
image example (modified to include a 'v')
As I'm not 100% sure if this will be fixed upstream, I'll queue up a workaround fix in the meantime (#30).
So this should be fixed in the next release that I'll publish at the end of the week.
image example (modified to include a 'v')
Great, thanks for this. What approach did you take, out of curiosity?
If it did need to be calculated from the curves, I was doing some searching and found this: http://pomax.nihongoresources.com/pages/bezier/
Great, thanks for this. What approach did you take, out of curiosity?
If it did need to be calculated from the curves, I was doing some searching and found this: http://pomax.nihongoresources.com/pages/bezier/
Have a look at bbox.rs in the pr. It's just a simple bounding box covering all points, including control points, rather than a tighter calculation of curve bounds.
I did have a quick look at the maths, but decided not to bother as this is a bug-workaround rather than core functionality. I'm also not sure how often we'll see this specific ttf issue.
I've published 0.2.8
with the bbox fallback
As per the title.
For the font "Airstrip Four", the 'v' character appears to not have a bounding box, so when the rasterizer runs, it tries to index into the Vec but it is out of bounds.
In more detail, I've done some research and did a write-up here: https://github.com/bevyengine/bevy/issues/1254
I cloned this repo, made a small change to the
image
example (below) to accept text as a second parameter, and downloaded airstrip.ttf into dev/fonts, and runcargo run --example image -- "dev/fonts/airstrip.ttf" "v"
. I put somedbg!()
s in places, and the output is below: