| Summary: | Multiline problems with TTF_SetFontOutline, | ||
|---|---|---|---|
| Product: | SDL_ttf | Reporter: | darth.wolfenstein |
| Component: | misc | Assignee: | Sylvain <sylvain.becker> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | unspecified | ||
| Hardware: | x86_64 | ||
| OS: | Windows 10 | ||
| Attachments: |
outlined multiline text
patch |
||
Created attachment 3448 [details] patch here's a patch, diff'ed with bug 4361 Fixed in https://hg.libsdl.org/SDL_ttf/rev/2c501c27c045 Can you try it ? I have actually never build SDL from scratch myself. I only get what I need from https://www.libsdl.org/projects/SDL_ttf/ or use nuget. I can comfirm it works with several new lines now. |
Created attachment 3440 [details] outlined multiline text When you use TTF_SetFontOutline() to set outline on a text,. the outlined text get moved down right by the thickness of the outline. When you only print one line this is not a problem at all because you just move the outlined text up and to the left to make the outline fit with the actual text. But when you use outline on TTF_RenderUTF8_Blended_Wrapped() there is a problem. The outlined text gets moved down for every line. Making the outline and the text not fit, see attachment. I use something like this to print the text twice to get text with visible outline. 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); I think outlined text should automatically "fit" un-outlined text.