TTF_GetFontWeight(3)
Okay so TTF_GetFontWeight is the main character of this page, and we're hanging out in the SDL_ttf3 FUNCTIONS manual. Buckle up, bestie π
πΈ NAME πΈ
TTF_GetFontWeight β query a font's weight, aka how light or heavy its strokes are. It's literally the vibe check for your font's stroke thickness β¨ποΈ
π¦ HEADER FILE π¦
Defined in SDL3_ttf/SDL_ttf.h. Slay π«Ά
β¨ SYNOPSIS β¨
Here's the exact tea, bestie β the function signature plus the whole squad of named weight values:
#include "SDL3_ttf/SDL_ttf.h"
int TTF_GetFontWeight(const TTF_Font *font);
#define TTF_FONT_WEIGHT_THIN 100 /**< Thin (100) named font weight value */
#define TTF_FONT_WEIGHT_EXTRA_LIGHT 200 /**< ExtraLight (200) named font weight value */
#define TTF_FONT_WEIGHT_LIGHT 300 /**< Light (300) named font weight value */
#define TTF_FONT_WEIGHT_NORMAL 400 /**< Normal (400) named font weight value */
#define TTF_FONT_WEIGHT_MEDIUM 500 /**< Medium (500) named font weight value */
#define TTF_FONT_WEIGHT_SEMI_BOLD 600 /**< SemiBold (600) named font weight value */
#define TTF_FONT_WEIGHT_BOLD 700 /**< Bold (700) named font weight value */
#define TTF_FONT_WEIGHT_EXTRA_BOLD 800 /**< ExtraBold (800) named font weight value */
#define TTF_FONT_WEIGHT_BLACK 900 /**< Black (900) named font weight value */
#define TTF_FONT_WEIGHT_EXTRA_BLACK 950 /**< ExtraBlack (950) named font weight value */
π FUNCTION PARAMETERS π
fontβ the font to query. Like, the font you're asking about. That's the parameter, bestie π
π₯ RETURN VALUE π₯
Returns the font's current weight. So it hands you back the weight value, periodt π
π§ THREAD SAFETY π§
This function should be called on the thread that created the font. fr fr β keep it on that thread, okay? Don't be out here doing thread chaos π
π AVAILABILITY π
This function is available since SDL_ttf 3.2.2. Iconic π
kisses and sparkles πβ¨ β source SDL_ttf, version SDL_ttf 3.2.2, page TTF_GetFontWeight(3). The original footer didn't print a date, so: date not listed, only vibes π
π¦ where this page comes from
- debian trixie: libsdl3-ttf-doc 3.2.2+ds-1 Β· Zlib
- 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-1017 on : a language model's rewrite of the original, under its terms