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

Multiline problems with TTF_SetFontOutline, #95

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Multiline problems with TTF_SetFontOutline, #95

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: unspecified
Reported for operating system, platform: Windows 10, x86_64

Comments on the original bug report:

On 2018-11-03 17:45:36 +0000, wrote:

Created attachment 3440
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.

On 2018-11-06 13:53:23 +0000, Sylvain wrote:

Created attachment 3448
patch

here's a patch,
diff'ed with bug 4361

On 2018-12-18 08:36:23 +0000, Sylvain wrote:

Fixed in https://hg.libsdl.org/SDL_ttf/rev/2c501c27c045
Can you try it ?

On 2018-12-22 11:35:00 +0000, wrote:

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.

On 2019-05-25 21:31:23 +0000, wrote:

I can comfirm it works with several new lines now.

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

1 participant