TTF_SetFontOutline(3)
π TTF_SetFontOutline(3) π
okay bestie, welcome to the SDL_ttf3 FUNCTIONS corner of the group chat π«Ά today's main character is TTF_SetFontOutline, and she's here to give your font a lil glow-up around the edges. yes, literally an outline. iconic behavior.
β¨ NAME β¨
TTF_SetFontOutline β sets a font's current outline. that's it, that's the whole vibe π
π HEADER FILE π
she lives in SDL3_ttf/SDL_ttf.h. that's where you'll find her defined, no cap.
πΈ SYNOPSIS πΈ
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_SetFontOutline(TTF_Font *font, int outline);
look at that signature. clean. stunning. slay.
π« DESCRIPTION π«
so here's the tea π β when you set the font outline, this function pulls in a whole little committee of font properties to make it happen:
TTF_PROP_FONT_OUTLINE_LINE_CAP_NUMBERTTF_PROP_FONT_OUTLINE_LINE_JOIN_NUMBERTTF_PROP_FONT_OUTLINE_MITER_LIMIT_NUMBER
those three get used when setting the font outline. periodt.
and it doesn't stop there, bestie β this also updates any TTF_Text objects using this font, and it clears already-generated glyphs, if any, from the cache. so like, she refreshes the whole friend group, not just herself. the way that she keeps everyone in sync ππ
π FUNCTION PARAMETERS π
fontβ the font you're giving a brand new outline to. your canvas, your queen πoutlineβ a positive outline value, or0to go back to the default. (yes,0is the "never mind, back to factory settings" option π )
π₯ RETURN VALUE π₯
Returns true on success or false on failure. if it flops, call SDL_GetError() for more info β she will tell you exactly what went wrong, fr fr.
π§ THREAD SAFETY π§
this function should be called on the thread that created the font. don't be messy and call her from some random thread, bestie β she's loyal like that π
β AVAILABILITY β
this function has been available since SDL_ttf 3.0.0. so she's been serving looks for a while now.
π SEE ALSO π
β’(3)TTF_GetFontOutline(3)
lowkey important reminder:outlinewants a positive value, and0means default. don't come at her with some negative nonsense, okay? π«Ά
kay that's the whole page, you're basically a font outline expert now π β¨ go forth and outline responsibly, bestie π¦
this lil gem comes from the SDL_ttf manual, version SDL_ttf 3.2.2 β mwah, sending love from the SDL_ttf squad ππ
π¦ where this page comes from
- debian trixie: libsdl3-ttf-doc 3.2.2+ds-1 Β· Zlib
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- ubuntu questing: libsdl3-ttf-doc 3.2.2+ds-1
- ubuntu resolute: libsdl3-ttf-doc 3.2.2+ds-1build1 Β· Zlib
- ubuntu stonking: libsdl3-ttf-doc 3.2.2+ds-2 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms