fcft_grapheme_rasterize - Man Page

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

  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) for a description of struct fcft_glyph.

See Also

fcft_destroy(3), fcft_glyph_rasterize(3)

Info

2021-04-14 2.3.3 fcft