fcft\_rasterize\_text\_run\_utf32(3) fcft fcft\_rasterize\_text\_run\_utf32(3)

# [NAME](#NAME)

fcft\_rasterize\_text\_run\_utf32 - rasterize a series of glyphs for a text string

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;fcft/fcft.h&gt;**

**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](#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*.

*subpixel* allows you to specify which subpixel mode to use. See **fcft\_rasterize\_char\_utf32**() for details.

The string is first segmented into grapheme clusters using utf8proc. Each grapheme is assigned a font using the normal font lookup rules (see **fcft\_rasterize\_char\_utf32**()).

Next, HarfBuzz is used to guess each grapheme's script (~language). Consecutiv graphemes that both have been assigned the same font, and belong to the same script are merged into a "partial" text run.

Finally, each partial text run is shaped with HarfBuzz.

# [RETURN VALUE](#RETURN_VALUE)

On error, NULL is returned.

On success, a pointer to a dynamically allocated text-run is returned:

```
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.

Note that the glyphs' *cols* member are invalid.

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](#SEE_ALSO)

**fcft\_text\_run\_destroy**(), **fcft\_rasterize\_char\_utf32**(), **fcft\_rasterize\_grapheme\_utf32**()

2026-10-30 3.3.3

---

Document: fcft_rasterize_text_run_utf32(3) from fcft 3.3.3-r6 (Chainguard OS)
Source: https://codeberg.org/dnkl/fcft
