fcft_font_options_create(3) | fcft | fcft_font_options_create(3) |
NAME
fcft_font_options_create - instantiate a new font
SYNOPSIS
#include <fcft/fcft.h>
struct fcft_font_options *fcft_font_options_create(void);
DESCRIPTION
fcft_font_options_create() allocates a struct fcft_font_options object to be used with fcft_from_name2(3).
The returned object will be initialized with default values. Manually set struct members to override.
Note: you must use fcft_font_options_create() to allocate the options object; do not allocate it yourself, neither from the heap or on the stack. This is to ensure forward compatibility.
struct fcft_font_options { enum fcft_emoji_presentation emoji_presentation; struct { bool srgb_decode; pixman_format_code_t format; } color_glyphs; uint32_t reserved; };
EMOJI PRESENTATION
emoji_presentation configures the default presentation style to use with emojis with both a text presentation, and an emoji presentation style.
These emojis can be followed by an (invisible) variation selector. When they are not followed by a selector, the implementation must choose a style.
One example of such an emoji is U+263A - WHITE SMILING FACE:
- unqualified: ☺
- text: ☺
- emoji: ☺️
The Unicode standard defines the default presentation styles, and this is what fcft defaults to.
However, in some cases, the application may want to always use either the text style, or the emoji style.
This is what emoji_presentation is for. Possible values are:
- FCFT_EMOJI_PRESENTATION_DEFAULT
- FCFT_EMOJI_PRESENTATION_TEXT
- FCFT_EMOJI_PRESENTATION_EMOJI
To re-iterate; this setting affects emoji's without an explicit variation selector. In other words, it overrides the default presentation style.
FCFT_EMOJI_PRESENTATION_DEFAULT is the default, and causes fcft to use the default presentation as defined by Unicode.
FCFT_EMOJI_PRESENTATION_TEXT forces all multi-presentation style emojis to be rendered in their text presentation style.
FCFT_EMOJI_PRESENTATION_EMOJI forces all multi-presentation style emojis to be rendered in their emoji presentation style.
COLOR GLYPHS
srgb_decode: when true, the pixel data will be decoded from sRGB to linear space. When false (the default), the pixel data is used as is.
format defines the pixman surface format to use for color glyphs. The default is PIXMAN_a8r8g8b8. One use is to enable higher color precision when srgb_decode is enabled, to avoid loss of precision when decoding from sRGB.
SEE ALSO
fcft_from_name2(), fcft_font_options_destroy()
2025-03-06 | 3.2.0 |