root / proj / libs / graph / include / font.h @ 318
History | View | Annotate | Download (1.13 KB)
1 | 182 | up20180642 | #ifndef FONT_H_INCLUDED
|
---|---|---|---|
2 | #define FONT_H_INCLUDED
|
||
3 | |||
4 | 314 | up20180642 | struct font;
|
5 | typedef struct font font_t; |
||
6 | font_t* (font_ctor)(const char *s); |
||
7 | int (font_dtor)(font_t *p);
|
||
8 | |||
9 | int (font_init)(void); |
||
10 | const font_t* font_get_default(void); |
||
11 | const font_t* font_get_consolas(void); |
||
12 | int (font_free)(void); |
||
13 | |||
14 | typedef enum{ |
||
15 | 188 | up20180642 | text_valign_top = -1,
|
16 | text_valign_center = 0,
|
||
17 | text_valign_bottom = 1
|
||
18 | 314 | up20180642 | } text_valign; |
19 | 188 | up20180642 | |
20 | 314 | up20180642 | typedef enum{ |
21 | 188 | up20180642 | text_halign_left = -1,
|
22 | text_halign_center = 0,
|
||
23 | text_halign_right = 1
|
||
24 | 314 | up20180642 | } text_halign; |
25 | 188 | up20180642 | |
26 | 183 | up20180642 | struct text;
|
27 | typedef struct text text_t; |
||
28 | text_t* (text_ctor)(const font_t *fnt, const char *txt); |
||
29 | void (text_dtor)(text_t *p);
|
||
30 | 250 | up20180655 | char* (text_get_string)(const text_t *p); |
31 | 314 | up20180642 | void (text_set_string)(text_t *p, const char *txt); |
32 | 188 | up20180642 | void (text_set_pos) (text_t *p, int16_t x, int16_t y);
|
33 | void (text_set_size) (text_t *p, unsigned size); |
||
34 | void (text_set_color) (text_t *p, uint32_t color);
|
||
35 | 314 | up20180642 | void (text_set_valign)(text_t *p, text_valign valign);
|
36 | void (text_set_halign)(text_t *p, text_halign halign);
|
||
37 | 297 | up20180642 | int16_t (text_get_x) (const text_t *p);
|
38 | int16_t (text_get_y) (const text_t *p);
|
||
39 | 314 | up20180642 | int (text_draw) (const text_t *p); |
40 | 182 | up20180642 | |
41 | #endif //FONT_H_INCLUDED |