TTF_GetFontProperties(3)
π TTF_GetFontProperties(3) π
okay bestie, this one's from the SDL_ttf3 FUNCTIONS lineup, and it's lowkey the little key that unlocks a font's whole property bag. let's get into it π«Ά
β¨ NAME β¨
TTF_GetFontProperties β get the properties associated with a font. that's it, that's the whole job, and she does it flawlessly π
πΈ HEADER FILE πΈ
she lives in SDL3_ttf/SDL_ttf.h, bestie. don't forget to include her or the compiler will be like "who??" π
π SYNOPSIS π
#include "SDL3_ttf/SDL_ttf.h"
SDL_PropertiesID TTF_GetFontProperties(TTF_Font *font);
#define TTF_PROP_FONT_OUTLINE_LINE_CAP_NUMBER SDL_ttf.font.outline.line_cap"
#define TTF_PROP_FONT_OUTLINE_LINE_JOIN_NUMBER SDL_ttf.font.outline.line_join"
#define TTF_PROP_FONT_OUTLINE_MITER_LIMIT_NUMBER SDL_ttf.font.outline.miter_limit"
look at those three #defines just sitting there, being all iconic π
π DESCRIPTION π
so SDL hands you the following read-write properties, and ngl they're all about outlines. here's the full lineup, no skips:
TTF_PROP_FONT_OUTLINE_LINE_CAP_NUMBER: theFT_Stroker_LineCapvalue used when setting the font outline, and she defaults toFT_STROKER_LINECAP_ROUND.TTF_PROP_FONT_OUTLINE_LINE_JOIN_NUMBER: theFT_Stroker_LineJoinvalue used when setting the font outline, defaults toFT_STROKER_LINEJOIN_ROUND.TTF_PROP_FONT_OUTLINE_MITER_LIMIT_NUMBER: theFT_Fixedmiter limit used when setting the font outline, defaults to0.
that's the whole vibe check. three properties, all read-write, all yours π
π¦ FUNCTION PARAMETERS π¦
fontβ the font to query. she's the main character here, obviously.
π RETURN VALUE π
returns a valid property ID on success, or 0 on failure. and if you get that 0, do not just sit there β call SDL_GetError() for more information, bestie, the error message is right there waiting for you π
β THREAD SAFETY β
it is safe to call this function from any thread. yes, ANY thread. she's that flexible, no cap π§
π AVAILABILITY π
this function has been available since SDL_ttf 3.0.0. og status fr fr.
πΈ little reminder: those three properties are read-write, so you're not just peeking β you can set them too. handle with care, queen π
and that's the page!! this gorgeous little writeup came to you courtesy of SDL_ttf 3.2.2 β mwah, drink water, and go query some fonts ππβ¨
π¦ 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