TTF_SetFontOutline on Wrapped text gives unexpected behavior

When I try to print multi line outlined text I get undesired effects. Every linebreak “moves” the outline one pixel down compared to the not outlined text. It is not a lot of work to write a workaround for this but it is still unintuitive compared to what you expect when setting outline for text.
When TTF_SetFontOutline is used, then the space between the lines should decrease by the thickness of the outline in my opinion.

To render text with an outline I use something like this. The font I use is Amiga4ever Pro 2.

if(_text.outline > 0)
    TTF_SetFontOutline(_fonts[_text.font], _text.outline);
    _RenderTextBackend(_text.text, _text.font, _text.outlinecolor, _text.pos, _text.width, _text.utf8, _text.outline);
    TTF_SetFontOutline(_fonts[_text.font], 0);
_RenderTextBackend(_text.text, _text.font, _text.color, _text.pos, _text.width, _text.utf8, 0);

The back end function use TTF_RenderUTF8_Blended_Wrapped()

I think you’re right. This happens in current stable release and also in head, I can make a fix for that.
Please, fill a bug

1 Like