-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbmfont.h
34 lines (26 loc) · 1.06 KB
/
bmfont.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* bmfont.h -- proportional bitmap font engine */
#ifndef DPTLIB_BMFONT_H
#define DPTLIB_BMFONT_H
#include "base/result.h"
#include "geom/point.h"
#include "framebuf/screen.h"
typedef struct bmfont bmfont_t;
typedef int bmfont_width_t; /* in pixels */
result_t bmfont_create(const char *png, bmfont_t **bmfont);
void bmfont_destroy(bmfont_t *bmfont);
void bmfont_get_info(bmfont_t *bmfont, int *width, int *height);
result_t bmfont_measure(bmfont_t *bmfont,
const char *text,
int len,
bmfont_width_t target_width,
int *split_point,
bmfont_width_t *actual_width);
result_t bmfont_draw(bmfont_t *bmfont,
screen_t *scr,
const char *text,
int len,
colour_t fg,
colour_t bg,
const point_t *pos,
point_t *end_pos);
#endif /* DPTLIB_BMFONT_H */