Skip to content
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

UI2: fix font metrics #2657

Open
matejcik opened this issue Nov 23, 2022 · 0 comments
Open

UI2: fix font metrics #2657

matejcik opened this issue Nov 23, 2022 · 0 comments
Assignees
Labels
code Code improvements

Comments

@matejcik
Copy link
Contributor

image

display_text_render accepts the coordinates of the baseline, i.e., is allowed to render below the provided y coordinate.

TextLayout renderer is calculating its cursor position based on text_height only, i.e., it will also render below its bounds and waste the baseline worth of space on the top.
While the fix looks easy in code (subtract baseline from the cursor y), this will shift pretty much all the text everywhere, so the impact will be far reaching.

On a similar note, we mostly use reported text_height, but it turns out that some characters are actually taller. We should be using calculated text_max_height for purposes of bounds fitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code improvements
Projects
Status: No status
Development

No branches or pull requests

2 participants