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 π
β’(3)TTF_SetFontSizeDPI(3)β the other half of the duo, go read her too π
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
- 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