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

Enhancement: in new text rendering library, prevent shrinking of text #53

Open
Emersont1 opened this issue May 11, 2020 · 7 comments
Open

Comments

@Emersont1
Copy link
Contributor

Emersont1 commented May 11, 2020

in the new text rendering, can you ensure the height of the text does not do this
Peek 2020-05-11 09-42
by making sure the empty texture goes as far down as the standard (or max?) descent of a glyph even if there are no characters with any descents (the full line height?)

image
(diagram added for clarity)

@Emersont1
Copy link
Contributor Author

I'm an idiot, I hadn't set the editbox to be tall enough in my code

@Emersont1
Copy link
Contributor Author

However, it would be a nice thing to consider so this jumping doesn't occur
Peek 2020-05-11 10-01

@Emersont1 Emersont1 reopened this May 11, 2020
@mobius3
Copy link
Owner

mobius3 commented May 11, 2020

Font Chef (the new library) handles things differently, it does not output a texture with rendered text, it outputs a series of clipping and target rects to render from a glyph atlas so in theory this would not happen, but I will make sure.

@mobius3
Copy link
Owner

mobius3 commented May 11, 2020

Maybe if you have an even larger editbox, it does not happen?

@Emersont1
Copy link
Contributor Author

Peek 2020-05-11 17-32
This is taking the size to the slightly ludicrous (h=100, font size = 16), but it still has that issue

@mobius3
Copy link
Owner

mobius3 commented May 11, 2020

Yiep. Thing is, when we get the text back from SDL, baseline information is lost. A good workaround would be instead of vertically centering things using the height of the returned surface, use TTF_FontHeight. I gather that this fix might not be hard to make.

@Emersont1
Copy link
Contributor Author

An urgent fix isn't really required, it was just something that ought to be took into consideration for fontchef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants