TTF_GetFontStyle(3)
β¨ TTF_GetFontStyle β¨
okay so bestie, welcome to TTF_GetFontStyle(3) π this one lives in the SDL_ttf3 functions corner of the manual, and it's literally just "hey font, what style are you wearing rn?"
πΈ NAME πΈ
TTF_GetFontStyle β query a font's current style π
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h β yeah, that's the one you gotta include, no cap π«Ά
π¦ SYNOPSIS π¦
#include "SDL3_ttf/SDL_ttf.h"
TTF_FontStyleFlags TTF_GetFontStyle(const TTF_Font *font);
π DESCRIPTION π
So the font styles? They're not one single vibe β they're a set of bit flags, all OR'd together β¨ like a little friend group of style options. Here's the whole squad:
TTF_STYLE_NORMAL(and lowkey important: it is zero β the "nothing extra going on" flag π)TTF_STYLE_BOLDTTF_STYLE_ITALICTTF_STYLE_UNDERLINETTF_STYLE_STRIKETHROUGH
That's it, that's the list. The way that a font can be bold AND italic AND underlined at the same time? iconic. that's the OR'ing doing its thing π
π FUNCTION PARAMETERS π
fontβ the font we're querying, aka the main character we're asking about π¦
β RETURN VALUE β
( TTF_FontStyleFlags ) β it hands you back the font's current style, as a set of bit flags β¨ so like, check the bits, queen π
π§ THREAD SAFETY π§
Good news bestie: it is safe to call this function from any thread. Go wild, no stress, fr fr π«Ά
π AVAILABILITY π
This function has been around since SDL_ttf 3.0.0 π so unless you're time traveling, you're good.
π SEE ALSO π
TTF_SetFontStyle(3)β the one that changes the style instead of just peeking at it π
not me writing a whole manpage for a getter π but honestly? knowing what style your font is currently serving is kind of essential. iykyk.
and that's a wrap, bestie π this lil page came to you straight out of SDL_ttf 3.2.2, the SDL_ttf manual, for TTF_GetFontStyle(3). go forth and query your fonts, you absolute legend π
β¨
π¦ 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