File: fcft_init.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 (65 lines) | stat: -rw-r--r-- 1,525 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
fcft_init(3) "3.3.3" "fcft"

# NAME

fcft_init - initialize the library

# SYNOPSIS

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

*bool fcft_init(
	enum fcft_log_colorize* _colorize_*, bool* _do\_syslog_*,
	enum fcft_log_class* _log\_level_*);*

# DESCRIPTION

*fcft_init*() initializes the fcft library, and must be called before
instantiating any fonts.

Since it also initializes logging, you may also want to ensure it is
called before any other functions affecting the library state. For
example, *fcft_set_scaling_filter*().

_colorize_ is one of:

```
enum fcft_log_colorize {
    FCFT_LOG_COLORIZE_NEVER,
    FCFT_LOG_COLORIZE_ALWAYS,
    FCFT_LOG_COLORIZE_AUTO
};
```

*FCFT_LOG_COLORIZE_AUTO* enables colors if stderr is a TTY.

if _do\_syslog_ is set, fcft will log to syslog, in addition to the
regular logging on stderr.

Note that fcft does not call *openlog*(), even if _do\_syslog_ is
set. Do this from the calling application. Before, or after calling
*fcft_init*() does not matter, as long as it is done before calling
any other fcft API functions.

Finally, _log\_level_ configures which types of log messages that will be shown.
```

enum fcft_log_class {
    FCFT_LOG_CLASS_NONE,
    FCFT_LOG_CLASS_ERROR,
    FCFT_LOG_CLASS_WARNING,
    FCFT_LOG_CLASS_INFO,
    FCFT_LOG_CLASS_DEBUG
};
```

Note that this is not a bitmask; setting *FCFT_LOG_CLASS_INFO*, also
enables *FCFT_LOG_CLASS_WARNING* and *FCFT_LOG_CLASS_ERROR*.

# RETURN VALUE

True if initialization was successful, otherwise false.

# SEE ALSO

*fcft_fini*()