1fcft_rasterize_text_run_utf32(3) fcft fcft_rasterize_text_run_utf32(3)
2
3
4
6 fcft_rasterize_text_run_utf32 - rasterize a series of glyphs for a text
7 string
8
10 #include <fcft/fcft.h>
11
12 struct fcft_text_run *fcft_rasterize_text_run_utf32(
13 struct fcft_font *font, size_t len, const uint32_t text[static
14 len], enum fcft_subpixel subpixel);
15
17 fcft_rasterize_text_run_utf32() shapes and rasterizes the UTF-32 en‐
18 coded Unicode string text into a series of glyphs using the primary
19 font, and possibly one or more fallback fonts, in font.
20
21 subpixel allows you to specify which subpixel mode to use. See
22 fcft_rasterize_char_utf32() for details.
23
24 The string is first segmented into grapheme clusters using utf8proc.
25 Each grapheme is assigned a font using the normal font lookup rules
26 (see fcft_rasterize_char_utf32()).
27
28 Next, HarfBuzz is used to guess each grapheme's script (~language).
29 Consecutiv graphemes that both have been assigned the same font, and
30 belong to the same script are merged into a "partial" text run.
31
32 Finally, each partial text run is shaped with HarfBuzz.
33
35 On error, NULL is returned.
36
37 On success, a pointer to a dynamically allocated text-run is returned:
38
39 struct fcft_text_run {
40 const struct fcft_glyph **glyphs;
41 int *cluster;
42 size_t count;
43 };
44
45 Both glyphs and cluster are arrays with count elements. cluster con‐
46 tains the character offsets (in the original string) of each corre‐
47 sponding glyph.
48
49 Note that the glyphs' cols member are invalid.
50
51 The text-run is not cached in fcft. The calling application may cache
52 it for as long as it likes, including after the font has been de‐
53 stroyed.
54
55 The text-run must be free:d with fcft_text_run_destroy().
56
58 fcft_text_run_destroy(), fcft_rasterize_char_utf32(), fcft_raster‐
59 ize_grapheme_utf32()
60
61
62
633.1.6 2023-07-14 fcft_rasterize_text_run_utf32(3)