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 be NULL β€” 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