|
libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
|
#include <cairo.h>#include <cairo-ft.h>#include <ft2build.h>#include <FT_FREETYPE_H>#include "types.h"
Go to the source code of this file.
Macros | |
| #define | ft_err2str font_utils_ft_err2str |
| #define | try_load_font font_utils_try_load_font |
Functions | |
| const char * | font_utils_ft_err2str (FT_Error err) |
| bool_t | font_utils_try_load_font (const char *fontdir, const char *fontfile, FT_Library ft, FT_Face *font, cairo_font_face_t **cr_font) |
This file contains support utilities to help with font handling and Cairo font operations.
Definition in file font_utils.h.
| #define ft_err2str font_utils_ft_err2str |
For backwards compatibility with older code
Definition at line 46 of file font_utils.h.
| #define try_load_font font_utils_try_load_font |
For backwards compatibility with older code
Definition at line 53 of file font_utils.h.
| const char * font_utils_ft_err2str | ( | FT_Error | err | ) |
Translates an FT_Error error code into a human-readable string.
| bool_t font_utils_try_load_font | ( | const char * | fontdir, |
| const char * | fontfile, | ||
| FT_Library | ft, | ||
| FT_Face * | font, | ||
| cairo_font_face_t ** | cr_font | ||
| ) |
Simple font loading front-end.
| fontdir | A path to the directory from which to load the font. |
| fontfile | A font file name. This is concatenated onto the fontdir with a path separator. If you only want to provide one string with a full path to the font file, pass that in fontdir and set fontfile = NULL. |
| ft | FreeType library handle. |
| font | Return FreeType font face object pointer. Release this after the cairo font face object using FT_DoneFace. |
| cr_font | Return cairo font face object pointer. Release this before the freetype font face using cairo_font_face_destroy. |
B_TRUE if loading the font was successfull, B_FALSE otherwise. In case of error, the reason is logged using logMsg.