Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (1.13 KB)

1
#ifndef FONT_H_INCLUDED
2
#define FONT_H_INCLUDED
3

    
4
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
    text_valign_top    = -1,
16
    text_valign_center =  0,
17
    text_valign_bottom =  1
18
} text_valign;
19

    
20
typedef enum{
21
    text_halign_left   = -1,
22
    text_halign_center =  0,
23
    text_halign_right  =  1
24
} text_halign;
25

    
26
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
char* (text_get_string)(const text_t *p);
31
void (text_set_string)(text_t *p, const char *txt);
32
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
void (text_set_valign)(text_t *p, text_valign valign);
36
void (text_set_halign)(text_t *p, text_halign halign);
37
int16_t (text_get_x)  (const text_t *p);
38
int16_t (text_get_y)  (const text_t *p);
39
int     (text_draw)   (const text_t *p);
40

    
41
#endif //FONT_H_INCLUDED