-
Notifications
You must be signed in to change notification settings - Fork 25
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
Layout::height
seems too short
#119
Comments
So the current implementation of computed height computes the height of each line as However as you have discovered, it does not accurately measure how much space is actually needed for a visual rendering of the text. We do have this information, so we could definitely expose this in addition to the "layout line height". We could also consider making the line height computation (for the purposes of layout) configurable. In the meantime you might want to consider increasing the line height you are using. |
I see, this makes sense; in my case I am interested in the pixel bounds of the rendered glyph runs, and not so much about the typographic height, so that I can allocate an image large enough for rendering. But extra padding / line height will do in the meantime. |
The following example, adapted from
swash_render
, fails on my machine (Windows 11)Code
with
thread 'main' panicked at examples\swash_render\src/main.rs:197:25: Image index (86, 42) out of bounds (235, 42)
. It seems that the allocated image isn't tall enough. It does work correctly if I change the text toSamle Text
(without thep
). It's as if the height calculation didn't take into account the descender of thep
.The text was updated successfully, but these errors were encountered: