libdrawtext
view src/drawtext_impl.h @ 55:59e5858de836
fixed a bug in utf-8 decoding
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Thu, 15 Sep 2011 23:32:39 +0300 |
parents | |
children | 095ff7ca4e74 |
line source
1 #ifndef TEXT_IMPL_H_
2 #define TEXT_IMPL_H_
4 struct glyph {
5 int code;
6 float x, y, width, height;
7 /* normalized coords [0, 1] */
8 float nx, ny, nwidth, nheight;
9 float orig_x, orig_y;
10 float advance;
11 struct glyph *next;
12 };
14 struct dtx_glyphmap {
15 int ptsize;
17 int xsz, ysz;
18 unsigned char *pixels;
19 unsigned int tex;
21 int cstart, cend; /* character range */
22 int crange;
24 float line_advance;
26 struct glyph *glyphs;
27 struct dtx_glyphmap *next;
28 };
30 struct dtx_font {
31 /* freetype FT_Face */
32 void *face;
34 /* list of glyphmaps */
35 struct dtx_glyphmap *gmaps;
37 /* last returned glyphmap (cache) */
38 struct dtx_glyphmap *last_gmap;
39 };
42 #define fperror(str) \
43 fprintf(stderr, "%s: %s: %s\n", __func__, (str), strerror(errno))
45 #endif /* TEXT_IMPL_H_ */