Scroll to navigation

fcft_rasterize_grapheme_utf32(3) fcft fcft_rasterize_grapheme_utf32(3)


fcft_rasterize_grapheme_utf32 - rasterize glyph(s) for a grapheme cluster


#include <fcft/fcft.h>

const struct fcft_grapheme *fcft_rasterize_grapheme_utf32(

struct fcft_font *font, size_t len, const uint32_t grapheme_cluster[static len], enum fcft_subpixel subpixel);


fcft_rasterize_grapheme_utf32() rasterizes the grapheme cluster cluster using the primary font, or one of the fallback fonts, in font.

Each cluster element is an UTF-32 encoded Unicode codepoint.

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.

subpixel allows you to specify which subpixel mode to use. See fcft_rasterize_char_utf32() for details.


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()).

struct fcft_grapheme {

int cols;
size_t count;
const struct fcft_glyph **glyphs; };

cols is the number of "columns" the grapheme occupised (effectively) cp is the same cp from the fcft_rasterize_char_utf32() call.

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

glyphs is an array of rasterized glyphs. See fcft_rasterize_char_utf32() for a description of struct fcft_glyph.


fcft_destroy(), fcft_rasterize_char_utf32(), fcft_rasterize_text_run_utf32()

2022-02-11 3.0.1