TTF_GetGlyphKerning(3)
π TTF_GetGlyphKerning π
okay bestie, so this one lives in the SDL_ttf3 manual β it's a <pink>SDL_ttf</pink> function page, and it's literally the tool that tells you how much two glyphs wanna snuggle together. Let's get into it. π«Ά
β¨ NAME β¨
TTF_GetGlyphKerning β Query the kerning size between the glyphs of two UNICODE codepoints.
that's it. that's the whole vibe. two codepoints walk in, one number walks out. π
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h
π SYNOPSIS π
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_GetGlyphKerning(TTF_Font *font, Uint32 previous_ch, Uint32 ch, int *kerning);
πΈ FUNCTION PARAMETERS πΈ
fontβ the font you're querying. the main character. πprevious_chβ the previous codepoint, aka the one that came before. the before bestie.chβ the current codepoint. the now bestie.kerningβ a pointer that gets filled in with the kerning size between the two glyphs, in pixels. and yeah, it may beNULLβ no pressure, no stress, she can just vibe and hand you nothing back if you don't need the number. π
β RETURN VALUE β
Returns true on success or false on failure. and if it's giving failure, call SDL_GetError() for more information β that's your group chat for the deets on what went wrong. π
π§΅ THREAD SAFETY π§΅
This function should be called on the thread that created the font.
no cap, this one's not thread-hoppable β keep it on the font's home thread or she will simply not respect you. π
π AVAILABILITY π
This function is available since SDL_ttf 3.0.0. so if you're on something older than that... bestie, we gotta talk. β¨
and that's the page!! π¦ this whole thing shipped out with SDL_ttf 3.2.2 under the <purple>SDL_ttf</purple> name β TTF_GetGlyphKerning(3) β so if you ever need to cite her, that's the signature. mwah, go kern something gorgeous. ππ
π¦ 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