GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_fonts.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2024 Cyril Hrubis <metan@ucw.cz>
4 */
5
12#ifndef TEXT_GP_FONTS_H
13#define TEXT_GP_FONTS_H
14
15#include <text/gp_font.h>
16
17extern const gp_font_family *gp_font_family_default;
18
28const gp_font_family *gp_font_family_lookup(const char *family_name);
29
41const gp_font_face *gp_font_family_face_lookup(const gp_font_family *family, uint8_t style);
42
52const gp_font_face *gp_font_face_lookup(const char *family_name, uint8_t style);
53
57typedef struct gp_fonts_iter {
58 int16_t family_idx;
59 int16_t font_idx;
61
77
89 enum gp_fonts_iter_dir dir);
90
102 enum gp_fonts_iter_dir dir);
103
107#define GP_FONT_FAMILY_FOREACH(iter, family) \
108 for (family = gp_fonts_iter_family(iter, 0, GP_FONTS_ITER_FIRST); \
109 family; \
110 family = gp_fonts_iter_family(iter, 0, GP_FONTS_ITER_NEXT))
111
112#endif /* TEXT_GP_FONTS_H */
An in-memory font description.
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.
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.
gp_fonts_iter_dir
An iterator direction.
Definition gp_fonts.h:65
@ GP_FONTS_ITER_NEXT
Move to next.
Definition gp_fonts.h:71
@ GP_FONTS_ITER_NOP
No action.
Definition gp_fonts.h:67
@ GP_FONTS_ITER_FIRST
Move to first.
Definition gp_fonts.h:73
@ GP_FONTS_ITER_PREV
Move to previous.
Definition gp_fonts.h:69
@ GP_FONTS_ITER_LAST
Move to last.
Definition gp_fonts.h:75
A font face.
Definition gp_font.h:176
A font family.
Definition gp_font.h:265
Font family iterator.
Definition gp_fonts.h:57