1fcft_init(3) fcft fcft_init(3)
2
3
4
6 fcft_init - initialize the library
7
9 #include <fcft/fcft.h>
10
11 bool fcft_init(
12 enum fcft_log_colorize colorize, bool do_syslog, enum
13 fcft_log_class log_level);
14
16 fcft_init() initializes the fcft library, and must be called before in‐
17 stantiating any fonts.
18
19 Since it also initializes logging, you may also want to ensure it is
20 called before any other functions affecting the library state. For ex‐
21 ample, fcft_set_scaling_filter().
22
23 colorize is one of:
24
25 enum fcft_log_colorize {
26 FCFT_LOG_COLORIZE_NEVER,
27 FCFT_LOG_COLORIZE_ALWAYS,
28 FCFT_LOG_COLORIZE_AUTO
29 };
30
31 FCFT_LOG_COLORIZE_AUTO enables colors if stderr is a TTY.
32
33 if do_syslog is set, fcft will log to syslog, in addition to the regu‐
34 lar logging on stderr.
35
36 Note that fcft does not call openlog(), even if do_syslog is set. Do
37 this from the calling application. Before, or after calling fcft_init()
38 does not matter, as long as it is done before calling any other fcft
39 API functions.
40
41 Finally, log_level configures which types of log messages that will be
42 shown.
43
44 enum fcft_log_class {
45 FCFT_LOG_CLASS_NONE,
46 FCFT_LOG_CLASS_ERROR,
47 FCFT_LOG_CLASS_WARNING,
48 FCFT_LOG_CLASS_INFO,
49 FCFT_LOG_CLASS_DEBUG
50 };
51
52 Note that this is not a bitmask; setting FCFT_LOG_CLASS_INFO, also en‐
53 ables FCFT_LOG_CLASS_WARNING and FCFT_LOG_CLASS_ERROR.
54
56 True if initialization was successful, otherwise false.
57
59 fcft_fini()
60
61
62
633.1.6 2023-07-19 fcft_init(3)