fcft_kerning(3)

πŸ’– fcft_kerning β€” the "how close do these two letters wanna be" function πŸ’–

okay so bestie, this page lives in the fcft manual (section 3, the library-call girlies ✨), and it's all about one little function called fcft_kerning. no cap, it's short but it's important. let's get into it 🫢


✨ NAME ✨

fcft_kerning β€” literally calculates the kerning distance between two wide characters πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <fcft/fcft.h>

bool fcft_kerning(
    struct fcft_font *font, uint32_t left, uint32_t right, long
    *restrict x, long *restrict y);

πŸ¦‹ DESCRIPTION πŸ¦‹

so fcft_kerning() computes the kerning distances β€” x (horizontal, the side-to-side one) and y (vertical, the up-and-down one) β€” between the two wide characters left and right, and it gives you those distances in pixels, periodt.

both characters must exist in the primary font. like, must must. πŸ™ˆ

and here's the tea, bestie: fcft_kerning() is just a convenience function wrapping around FT_Get_Kerning(), which means it only supports legacy kern tables. if you were hoping for OpenType fonts' GPOS tables β€” nope, not supported, sorry babe 😭. fcft is not a text shaping library, and it's not trying to be. she's got main character energy in her own lane, iykyk.


πŸ”₯ RETURN VALUE πŸ”₯

on success, fcft_kerning() returns true, and x and y get updated with the kerning distance, in pixels. slay. ✨

on error, false is returned. and there's a whole list of reasons why that can happen, so let's do a vibe check πŸ’€:

  • the primary font does not have any kerning information.
  • one, or both, of the two characters have no corresponding glyph in the primary font.
  • there is no kerning information for this character combination.

🌸 EXAMPLE 🌸

see fcft_from_name() β€” yeah she's the one with the actual example, go look at her πŸ‘‘


ngl this one is a tiny page but it ate. remember: legacy kern tables only, both glyphs gotta exist, and false is just the function telling you the vibe wasn't there πŸ’œ

✨ that's the whole page, bestie ✨ β€” brought to you by fcft 3.3.3, dated 2026-04-09, and the fcft_kerning(3) header/footer duo. mwah πŸ’‹πŸŽ€πŸ’–

πŸ“¦ where this page comes from