---
name: "fcft_rasterize_char_utf32"
section: "3"
platform: "linux"
package: "fcft"
version: "3.3.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/fcft_rasterize_char_utf32"
---

# fcft\_rasterize\_char\_utf32(3)

rasterize a glyph for a single UTF-32 codepoint

## NAME

fcft\_rasterize\_char\_utf32 - rasterize a glyph for a single UTF-32 codepoint

## SYNOPSIS

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

**const struct fcft\_glyph \*fcft\_rasterize\_char\_utf32(**

**struct fcft\_font \****font***, uint32\_t** *cp***,** **enum fcft\_subpixel** *subpixel***);**

## DESCRIPTION

**fcft\_rasterize\_char\_utf32**() rasterizes the UTF-32 encoded Unicode codepoint *cp* using the primary font, or one of the fallback fonts, in *font*.

*cp* is first searched for in the primary font. If not found, the fallback fonts are searched (in the order they were specified in **fcft\_from\_name**()). If not found in any of the fallback fonts, the FontConfig fallback list for the primary font is searched.

*subpixel* allows you to specify which subpixel mode to use. It is one of:

```
enum fcft_subpixel {
    FCFT_SUBPIXEL_DEFAULT,
    FCFT_SUBPIXEL_NONE,
    FCFT_SUBPIXEL_HORIZONTAL_RGB,
    FCFT_SUBPIXEL_HORIZONTAL_BGR,
    FCFT_SUBPIXEL_VERTICAL_RGB,
    FCFT_SUBPIXEL_VERTICAL_BGR,
};
```

If **FCFT\_SUBPIXEL\_DEFAULT** is specified, the subpixel mode configured in FontConfig is used. If **FCFT\_SUBPIXEL\_NONE** is specified, grayscale antialiasing will be used. For all other values, the specified mode is used.

Note that if antialiasing has been disabled (in FontConfig, either globally, or specifically for the current font), then *subpixel* is ignored.

The intention is to enable programs to use per-monitor subpixel modes. Incidentally, **enum fcft\_subpixel** matches **enum** **wl\_output\_subpixel**, the enum used in Wayland.

Note: you probably do not want to use anything other than **FCFT\_SUBPIXEL\_NONE** if blending with a transparent background.

## RETURN VALUE

On error, NULL is returned.

On success, a pointer to a rasterized glyph is returned. The glyph 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 glyph 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_glyph {
    uint32_t cp;
    int cols;
    const char *font_name;
    pixman_image_t *pix;
    int x;
    int y;
    int width;
    int height;
    struct {
        int x;
        int y;
    } advance;
    bool is_color_glyph;
};
```

*cp* is the same *cp* from the **fcft\_rasterize\_char\_utf32**() call.

*cols* is the number of "columns" the glyph occupies (effectively, **wcwidth**(*cp***)**). Note that this value will be incorrect if wide characters (**wchar\_t**) is not UTF-32 encoded in the current locale.

*pix* is the rasterized glyph. Its format depends on a number of factors, but will be one of **PIXMAN\_a1**, **PIXMAN\_a8**, **PIXMAN\_x8r8g8b8**, **PIXMAN\_a8r8g8b8**. Use **pixman\_image\_get\_format**() to find out which one it is.

**PIXMAN\_a1** corresponds to **FT\_PIXEL\_MODE\_MONO**. I.e. the glyph is an un-antialiased bitmask. Use as a mask when blending.

**PIXMAN\_a8** corresponds to **FT\_PIXEL\_MODE\_GRAY**. I.e. the glyph is a grayscale antialiased bitmask. Use as a mask when blending.

**PIXMAN\_x8r8g8b8** corresponds to either **FT\_PIXEL\_MODE\_LCD** or **FT\_PIXEL\_MODE\_LCD\_V**. **pixman\_image\_set\_component\_alpha**() has been called by fcft for you. Use as a mask when blending.

**PIXMAN\_a8r8g8b8** corresponds to **FT\_PIXEL\_MODE\_BGRA**. I.e. the glyph is a plain RGBA image. Use as source when blending.

*x* is the glyph's horizontal offset, in pixels. Add this to the current pen position when blending.

*y* is the glyph's vertical offset, in pixels. Add this to the current pen position when blending.

*width* is the glyph's width, in pixels. Use as 'width' argument when blending.

*height* is the glyph's height, in pixels. Use as 'height' argument when blending.

*advance* is the glyph's 'advance', in pixels. Add this to the pen position after blending; *x* for a horizontal layout and *y* for a vertical layout.

*is\_color\_glyph* is true if the glyph is a color glyph, typically an emoji. When true, the glyph should be composited OVER the destination surface, instead of being used as a mask.

## EXAMPLE

See **fcft\_from\_name**()

## SEE ALSO

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