Project

General

Profile

Statistics
| Revision:

root / proj / libs / graph / include / font.h @ 313

History | View | Annotate | Download (1.09 KB)

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