kiwi icon indicating copy to clipboard operation
kiwi copied to clipboard

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

Open Emersont1 opened this issue 5 years ago • 7 comments

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 avatar May 11 '20 08:05 Emersont1

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

Emersont1 avatar May 11 '20 08:05 Emersont1

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

Emersont1 avatar May 11 '20 09:05 Emersont1

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 avatar May 11 '20 14:05 mobius3

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

mobius3 avatar May 11 '20 14:05 mobius3

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

Emersont1 avatar May 11 '20 16:05 Emersont1

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.

mobius3 avatar May 11 '20 17:05 mobius3

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

Emersont1 avatar May 11 '20 18:05 Emersont1