fcft_init(3)

πŸŽ€ NAME πŸŽ€

fcft_init β€” initialize the library. Yes bestie, this is the fcft_init(3) page from the fcft manual, and it’s literally the β€œwake up the library” ritual. πŸ’–

✨ SYNOPSIS ✨

#include <fcft/fcft.h>

bool fcft_init(
    enum fcft_log_colorize colorize, bool do_syslog, enum fcft_log_class
    log_level);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so fcft_init() initializes the fcft library, and it must be called before instantiating any fonts. No cap, it’s the prerequisite. 🫢

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(). Like, get the vibes set up first, y’know? ✨

🎨 The colorize parameter 🎨

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. Cute. 🌈

πŸ“ The do_syslog parameter πŸ“

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. πŸ’…

πŸ”₯ The log_level parameter πŸ”₯

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. It’s giving β€œpackage deal”, not β€œpick and choose”. periodt.

🌈 RETURN VALUE 🌈

True if initialization was successful, otherwise false. Slay. βœ…

πŸ‘‘ SEE ALSO πŸ‘‘

fcft_fini() β€” go check out that page too, bestie. 🫢


byeee bestie πŸ’– this page is from fcft version 3.3.3, dated 2026-04-09 β€” mwah! 🫢

πŸ“¦ where this page comes from