TTF_GetFontWeight(3)

πŸ“¦
version 3.2.2 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

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