15#include <text/gp_text_style.h>
16#include <text/gp_text_metric.h>
17#include <text/gp_fonts.h>
34typedef enum gp_text_attr {
36 GP_ALIGN_CENTER = 0x02,
37 GP_ALIGN_RIGHT = 0x03,
38 GP_ALIGN_HORIZ = 0x03,
39 GP_TEXT_BEARING = 0x04,
40 GP_VALIGN_ABOVE = 0x10,
41 GP_VALIGN_TOP = GP_VALIGN_ABOVE,
42 GP_VALIGN_CENTER = 0x20,
43 GP_VALIGN_BASELINE = 0x30,
44 GP_VALIGN_BELOW = 0x40,
45 GP_VALIGN_BOTTOM = GP_VALIGN_BELOW,
58 const char *str,
size_t max_chars);
103static inline gp_size gp_text_xxy(
gp_pixmap *pixmap,
const gp_text_style *style,
117 int halign = align & GP_ALIGN_HORIZ;
119 align &= ~GP_ALIGN_HORIZ;
123 align |= GP_ALIGN_RIGHT;
125 case GP_ALIGN_CENTER:
127 align |= GP_ALIGN_CENTER;
131 align |= GP_ALIGN_LEFT;
135 return gp_text(pixmap, style, x, y, align, fg_color, bg_color, str);
144 const char *str,
size_t max_chars);
152 __attribute__ ((format (printf, 8, 9)));
158 const
char *fmt, va_list va);
160__attribute__ ((format (printf, 9, 10)))
161static inline
gp_size gp_print_xxy(
gp_pixmap *pixmap, const gp_text_style *style,
177 int halign = align & GP_ALIGN_HORIZ;
179 align &= ~GP_ALIGN_HORIZ;
183 align |= GP_ALIGN_RIGHT;
185 case GP_ALIGN_CENTER:
187 align |= GP_ALIGN_CENTER;
191 align |= GP_ALIGN_LEFT;
196 ret = gp_vprint(pixmap, style, x, y, align, fg_color, bg_color, fmt, va);
205void gp_text_clear(
gp_pixmap *pixmap,
const gp_text_style *style,
212void gp_text_clear_str(
gp_pixmap *pixmap,
const gp_text_style *style,
214 gp_pixel bg_color,
const char *str);
uint32_t gp_pixel
Pixel integer value.
int gp_coord
Integer type for coordinates i.e. x, y, ...
unsigned int gp_size
Integer type for sizes i.e. w, h, ...