-
- Notifications
You must be signed in to change notification settings - Fork 216
Closed
Labels
Description
Description
SDL_TTF has outlining functionality! https://wiki.libsdl.org/SDL2_ttf/TTF_SetFontOutline.
We should port this functionality such that people can effectively render outlines on their text.
To do this, we could directly port the attribute and get/set it on the font, but then people will need two render calls, one for the outline and one for the text. For example:
font.outline = 2 text = font.render("Hello world", True, "orange") win.blit(text, (10, 10)) font.outline = 0 text = font.render("Hello world", True, "black") win.blit(text, (10 + width, 10 + width))We could also have something higher level, where it auto renders the outline in font.render. Random notes of that:
font.outline_width (attribute, get/set with TTF_ outline) font.outline_color (attribute, defaults to black) Render with an outline: font.render Render only the outline: font.render(outline_only kwarg) | font.render_outline_only() | font.outline_only