TTF_GetFontHinting(3)

πŸ’– TTF_GetFontHinting(3) πŸ’–

okay bestie, welcome to the SDL_ttf3 FUNCTIONS corner of the group chat 🫢 we're doing a lil read-only vibe check on your font today, no cap.


✨ NAME ✨

TTF_GetFontHinting β€” ask a font what its current FreeType hinter setting is. that's it. that's the whole job. lowkey iconic πŸ’…


🌸 HEADER FILE 🌸

it lives in SDL3_ttf/SDL_ttf.h, bestie. go get it.


πŸŽ€ SYNOPSIS πŸŽ€

#include "SDL3_ttf/SDL_ttf.h"

TTF_HintingFlags TTF_GetFontHinting(const TTF_Font *font);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the hinter setting is one single value. just one. not a buffet, not a whole menu, literally one vibe:

  • TTF_HINTING_NORMAL
  • TTF_HINTING_LIGHT
  • TTF_HINTING_MONO
  • TTF_HINTING_NONE
  • TTF_HINTING_LIGHT_SUBPIXEL β€” this one's the new girl ✨ she's available in SDL_ttf 3.0.0 and later, so if you're on an older version she simply does not exist yet, sorry babe 😭

πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • font β€” the font you wanna query. the one you're asking about. her. πŸ‘‘

⭐ RETURN VALUE ⭐

(TTF_HintingFlags) it hands you back your font's current hinter value, all cute and packaged. BUT β€” and this is the important part β€” if the font is invalid it returns TTF_HINTING_INVALID instead. so yeah, vibe check your font first fr fr πŸ™ˆ


🌈 THREAD SAFETY 🌈

it is safe to call this function from any thread. any of them. all of them. go feral, bestie, she don't mind 🧚


πŸ‘‘ AVAILABILITY πŸ‘‘

this function has been around since SDL_ttf 3.0.0. she's not new here, she's a seasoned main character.


πŸ”₯ SEE ALSO πŸ”₯

  • β€’(3)
  • TTF_SetFontHinting(3) β€” the one that actually sets the thing. this one just asks. iykyk πŸ’…

reminder bestie: this is a getter. she reads, she does not write. if you wanna change the hinting, that's a whole other function and you know exactly which one. periodt.

SDL_ttf Β· version SDL_ttf 3.2.2 Β· TTF_GetFontHinting(3) β€” mwah, go query some fonts, love u, bye πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from