TTF_GetFontDPI(3)

πŸ’– TTF_GetFontDPI πŸ’–

okay bestie, welcome to the TTF_GetFontDPI page, part of the SDL_ttf3 FUNCTIONS lineup 🫢 this is where you find out what resolution your font is actually vibing at. slay.


✨ NAME ✨

TTF_GetFontDPI β€” get font target resolutions, in dots per inch. yes, literally DPI. it's giving "how many little dots per inch is this font aiming for" πŸ’…


πŸ“ HEADER FILE πŸ“

defined in SDL3_ttf/SDL_ttf.h β€” that's the one, no cap πŸŽ€


🌸 SYNOPSIS 🌸

#include "SDL3_ttf/SDL_ttf.h"

bool TTF_GetFontDPI(TTF_Font *font, int *hdpi, int *vdpi);

look at her. three args, one bool, iconic behavior ✨


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • font β€” the font you're querying. the main character, the one we're asking about πŸ‘‘
  • hdpi β€” a pointer that gets filled in with the target horizontal DPI. you hand her a spot, she drops the number in πŸ’–
  • vdpi β€” a pointer that gets filled in with the target vertical DPI. same energy, but vertical 🌈

⭐ RETURN VALUE ⭐

returns true on success or false on failure 🫢 and if it fails? call SDL_GetError() for more info, because she WILL tell you what went wrong if you just ask 😭


🧡 THREAD SAFETY 🧡

this function should be called on the thread that created the font. do not be out here calling it from some random thread, bestie, that's not the vibe πŸ™ˆ

πŸŽ€ AVAILABILITY πŸŽ€

this function is available since SDL_ttf 3.0.0. she's been around, she's established, she ate ⭐


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page fr fr πŸ’– big love to the SDL_ttf crew β€” this one's from SDL_ttf 3.2.2, mwah, catch you on the next manpage πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from