---
name: "fcft_grapheme_rasterize"
section: "3"
platform: "linux"
package: "libfcft-doc"
version: "2.3.1-1"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/fcft_grapheme_rasterize"
---

# fcft\_grapheme\_rasterize(3)

rasterize a glyph for a grapheme cluster

## NAME

fcft\_grapheme\_rasterize - rasterize a glyph for a grapheme cluster

## SYNOPSIS

**#include \<fcft/fcft.h\>**

**const struct fcft\_grapheme \*fcft\_grapheme\_rasterize(**

**struct fcft\_font \****font***,** **size\_t** *len***, const wchar\_t** *grapheme\_cluster\[static len\]***,** **size\_t** *tag\_count***, const struct fcft\_layout\_tag** *tags***\[static tag\_count\],** **enum fcft\_subpixel** *subpixel***);**

## DESCRIPTION

**fcft\_grapheme\_rasterize**() rasterizes the grapheme cluster *cluster* using the primary font, or one of the fallback fonts, in *font*.

The fonts are searched for *all* codepoints in the grapheme cluster, starting with the primary font and then the custom fallback fonts, and finally the FontConfig provided fallback fonts.

*tags* is an optional array of OTF tags that will be used when shaping the grapheme:

```
struct fcft_layout_tag {
    char tag[4];
    unsigned value;
};
```

*subpixel* allows you to specify which subpixel mode to use. See [**fcft\_glyph\_rasterize**(3)](/fcft_glyph_rasterize/3.md) for details.

## RETURN VALUE

On error, NULL is returned.

On success, a pointer to a rasterized grapheme is returned. The grapheme is cached in fcft, making subsequent calls with the same arguments very fast (i.e. there is no need for programs to cache glyphs by themselves).

The grapheme object is managed by *font*. There is no need to explicitly free it; it is freed when *font* is destroyed (with [**fcft\_destroy**(3)](/fcft_destroy/3.md)).

```
struct fcft_grapheme {
    int cols;
    size_t count;
    const struct fcft_glyph **glyphs;
};
```

*cols* is the number of "columns" the grapheme occupised (effectively) *wc* is the same *wc* from the **fcft\_glyph\_rasterize**() call.

*cols* is the number of "columns" the glyph occupies (effectively, **wcswidth**(*cluster***)**).

*glyphs* is an array of rasterized glyphs. See [**fcft\_glyph\_rasterize**(3)](/fcft_glyph_rasterize/3.md) for a description of **struct fcft\_glyph**.

## SEE ALSO

[**fcft\_destroy**(3)](/fcft_destroy/3.md), [**fcft\_glyph\_rasterize**(3)](/fcft_glyph_rasterize/3.md)
