TTF_SetFontKerning(3)
π TTF_SetFontKerning(3) π
okay bestie, welcome to the SDL_ttf3 FUNCTIONS corner of the group chat β¨ this one lives in the SDL_ttf manual, and it's literally the switch that decides whether your font gets to do kerning or not. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
TTF_SetFontKerning β set if kerning is enabled for a font. that's it, that's the whole vibe π
πΈ HEADER FILE πΈ
it's defined in SDL3_ttf/SDL_ttf.h β yeah, you gotta include the header, no cap π
π¦ SYNOPSIS π¦
#include "SDL3_ttf/SDL_ttf.h"
void TTF_SetFontKerning(TTF_Font *font, bool enabled);
look at her. two arguments. returns nothing. absolutely iconic β¨
π DESCRIPTION π
so here's the tea: newly-opened fonts default to allowing kerning. that's the out-of-the-box behaviour, no setup required, she comes ready π
and ngl, that default is generally a good policy β unless you have a strong reason to disable it, because kerning tends to produce better rendering. like, lowkey it just makes your text look right.
to prove the point: with kerning disabled, some fonts might render the word kerning as something that looks like keming. yeah. π the letters just crash into each other. we do not want that.
also important bestie: this updates any TTF_Text objects using this font. so it's not just future text β existing text objects get the memo too π₯
π FUNCTION PARAMETERS π
fontβ the font to set kerning on. that's the one you're touching πenabledβtrueto enable kerning,falseto disable. binary choice, main character energy π
π THREAD SAFETY π
this function should be called on the thread that created the font. that's the rule, bestie β don't be out here calling it from some random thread, iykyk π
β AVAILABILITY β
this function is available since SDL_ttf 3.0.0 β¨ so if you're on 3.0.0 or later, you're slaying. if you're not, you're not π
π SEE ALSO π
β’(3),TTF_GetFontKerning(3)
like, obviously go read TTF_GetFontKerning(3) β that's the one that tells you what you set. and β’(3), whatever she is, she's invited too π¦
and that's the whole page, bestie!! no notes, she ate π this was SDL_ttf version 3.2.2, brought to you by the SDL_ttf manual herself β now go kern some letters responsibly, mwah πβ¨π«Ά
π¦ 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