fcft_rasterize_text_run_utf32(3)

okay so bestie, welcome to the fcft_rasterize_text_run_utf32(3) page from the fcft manual πŸ’– this one is all about turning a whole UTF-32 string into a text run, and it's lowkey iconic.

🌸 NAME 🌸

fcft_rasterize_text_run_utf32 β€” rasterize a series of glyphs for a text string ✨

✨ SYNOPSIS ✨

#include <fcft/fcft.h>

struct fcft_text_run *fcft_rasterize_text_run_utf32(
    struct fcft_font *font, size_t len, const uint32_t text[static len],
    enum fcft_subpixel subpixel);

πŸ’… DESCRIPTION πŸ’…

fcft_rasterize_text_run_utf32() shapes and rasterizes the UTF-32 encoded Unicode string text into a series of glyphs, using the primary font β€” and possibly one or more fallback fonts β€” in font 🫢

The subpixel argument lets you specify which subpixel mode to use. See fcft_rasterize_char_utf32() for the deets πŸ‘€

Here's the whole glow-up pipeline, bestie:

  1. The string is first segmented into grapheme clusters using utf8proc 🧚
  2. Each grapheme is assigned a font using the normal font lookup rules (see fcft_rasterize_char_utf32()) πŸ’…
  3. Next, HarfBuzz is used to guess each grapheme's script (~language) πŸ”₯
  4. Consecutive graphemes that both have been assigned the same font, and belong to the same script, are merged into a "partial" text run πŸŽ€
  5. Finally, each partial text run is shaped with HarfBuzz πŸ‘‘

πŸŽ€ RETURN VALUE πŸŽ€

On error, NULL is returned 😭

On success, you get a pointer to a dynamically allocated text-run:

struct fcft_text_run {
    const struct fcft_glyph **glyphs;
    int *cluster;
    size_t count;
};

Both glyphs and cluster are arrays with count elements. cluster contains the character offsets (in the original string) of each corresponding glyph ⭐

heads up: the glyphs' cols member are invalid β€” do not trust it πŸ’€

The text-run is not cached in fcft. The calling application may cache it for as long as it likes, including after the font has been destroyed 🫢

The text-run must be free:d with fcft_text_run_destroy() 🧚

πŸ¦‹ SEE ALSO πŸ¦‹

  • fcft_text_run_destroy()
  • fcft_rasterize_char_utf32()
  • fcft_rasterize_grapheme_utf32()

that's the whole vibe, bestie β€” brought to you by fcft version 3.3.3, dated 2026-04-09, signing off 🫢✨

πŸ“¦ where this page comes from