File: fcft_font_options_create.3.scd

package info (click to toggle)
fcft 3.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,248 kB
  • sloc: ansic: 8,184; python: 115; sh: 44; makefile: 4
file content (119 lines) | stat: -rw-r--r-- 3,457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
fcft_font_options_create(3) "3.3.3" "fcft"

# 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_scaling_filter scaling_filter;
    enum fcft_emoji_presentation emoji_presentation;

    struct {
        bool srgb_decode;
        pixman_format_code_t format;
    } color_glyphs;
};
```

# SCALING FILTER

Configures the filter the use when downscaling bitmap fonts (typically
emoji fonts).

Possible values are:

- *FCFT\_SCALING\_FILTER\_NONE*
- *FCFT\_SCALING\_FILTER\_NEAREST*
- *FCFT\_SCALING\_FILTER\_BILINEAR*
- *FCFT\_SCALING\_FILTER\_IMPULSE*
- *FCFT\_SCALING\_FILTER\_BOX*
- *FCFT\_SCALING\_FILTER\_LINEAR*
- *FCFT\_SCALING\_FILTER\_CUBIC*
- *FCFT\_SCALING\_FILTER\_GAUSSIAN*
- *FCFT\_SCALING\_FILTER\_LANCZOS2*
- *FCFT\_SCALING\_FILTER\_LANCZOS3*
- *FCFT\_SCALING\_FILTER\_LANCZOS3\_STRETCHED*

*FCFT\_SCALING\_FILTER\_NONE* disables filtering.

*FCFT\_SCALING\_FILTER\_NEAREST* and
*FCFT\_SCALING\_FILTER\_BILINEAR* are traditional filters, with
_nearest_ being the fastest.

The rest are separable convolution filters.

The default is *FCFT\_SCALING\_FILTER\_CUBIC*.

# 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*()