GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A font lookup functions. More...
#include <text/gp_font.h>
Go to the source code of this file.
Data Structures | |
struct | gp_fonts_iter |
Font family iterator. More... | |
Macros | |
#define | GP_FONT_FAMILY_FOREACH(iter, family) |
A loop over all compiled in fonts. | |
Typedefs | |
typedef struct gp_fonts_iter | gp_fonts_iter |
Font family iterator. | |
Enumerations | |
enum | gp_fonts_iter_dir { GP_FONTS_ITER_NOP = 0 , GP_FONTS_ITER_PREV = -1 , GP_FONTS_ITER_NEXT = 1 , GP_FONTS_ITER_FIRST = -2 , GP_FONTS_ITER_LAST = 2 } |
An iterator direction. More... | |
Functions | |
const gp_font_family * | gp_font_family_lookup (const char *family_name) |
Font family lookup. | |
const gp_font_face * | gp_font_family_face_lookup (const gp_font_family *family, uint8_t style) |
Looks up a font face in a family given a style flags. | |
const gp_font_face * | gp_font_face_lookup (const char *family_name, uint8_t style) |
Looks up a font face in a family given a family name and style flags. | |
const gp_font_face * | gp_fonts_iter_font (gp_fonts_iter *iter, int wrap, enum gp_fonts_iter_dir dir) |
Iterates over all compiled in fonts. | |
const gp_font_family * | gp_fonts_iter_family (gp_fonts_iter *iter, int wrap, enum gp_fonts_iter_dir dir) |
Iterates over all compiled in families. | |
enum gp_fonts_iter_dir |
An iterator direction.
Enumerator | |
---|---|
GP_FONTS_ITER_NOP | No action. |
GP_FONTS_ITER_PREV | Move to previous. |
GP_FONTS_ITER_NEXT | Move to next. |
GP_FONTS_ITER_FIRST | Move to first. |
GP_FONTS_ITER_LAST | Move to last. |
Definition at line 65 of file gp_fonts.h.
const gp_font_face * gp_font_face_lookup | ( | const char * | family_name, |
uint8_t | style | ||
) |
Looks up a font face in a family given a family name and style flags.
family_name | A family name such as 'gfxprim', 'tiny', etc. |
style | A bitmask of enum gp_font_style. If GP_FONT_FALLBACK is passed the function never returns NULL. |
const gp_font_face * gp_font_family_face_lookup | ( | const gp_font_family * | family, |
uint8_t | style | ||
) |
Looks up a font face in a family given a style flags.
If family pointer is a null default 'gfxprim' family is used instead.
family | A pointer to a font family. If NULL is passed default is used. |
style | A bitmask of enum gp_font_style. If GP_FONT_FALLBACK is passed the function never returns NULL. |
const gp_font_family * gp_font_family_lookup | ( | const char * | family_name | ) |
Font family lookup.
Looks up a font family by a family name in the compiled in fonts.
family_name | A family name, such as 'gfxprim', 'tiny', etc. |
const gp_font_family * gp_fonts_iter_family | ( | gp_fonts_iter * | iter, |
int | wrap, | ||
enum gp_fonts_iter_dir | dir | ||
) |
Iterates over all compiled in families.
iter | An iterator. |
wrap | If non zero makes the iteration circular, i.e. NULL is not returned at the end. |
dir | Direction to move to. |
const gp_font_face * gp_fonts_iter_font | ( | gp_fonts_iter * | iter, |
int | wrap, | ||
enum gp_fonts_iter_dir | dir | ||
) |
Iterates over all compiled in fonts.
iter | An iterator. |
wrap | If non zero makes the iteration circular, i.e. NULL is not returned at the end. |
dir | Direction to move to. |