Rev 5520 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5520 | Rev 5598 | ||
---|---|---|---|
1 | // Truetype library |
1 | // Truetype library |
- | 2 | #ifndef INCLUDE_LIBTRUETYPE_H |
|
- | 3 | #define INCLUDE_LIBTRUETYPE_H |
|
- | 4 | ||
- | 5 | #ifndef INCLUDE_KOLIBRI_H |
|
- | 6 | #include "../lib/kolibri.h" |
|
- | 7 | #endif |
|
- | 8 | ||
- | 9 | #ifndef INCLUDE_DLL_H |
|
- | 10 | #include "../lib/dll.h" |
|
2 | 11 | #endif |
|
3 | dword libtruetype = #att_libtruetype; |
12 | dword libtruetype = #att_libtruetype; |
4 | char att_libtruetype[22] = "/sys/lib/truetype.obj\0"; |
13 | char att_libtruetype[22] = "/sys/lib/truetype.obj\0"; |
5 | 14 | ||
6 | dword truetype = #att_truetype; // truetype(unsigned char *s, stbtt_fontinfo *buffer, char *screen1, int width, int height) |
15 | dword truetype = #att_truetype; // truetype(unsigned char *s, stbtt_fontinfo *buffer, char *screen1, int width, int height) |
7 | dword get_length = #att_get_length; // get_length(unsigned char *s, char *buffer, int height, int max_len) |
16 | dword get_length = #att_get_length; // get_length(unsigned char *s, char *buffer, int height, int max_len) |
8 | dword get_width = #att_get_width; // get_width_utf8(unsigned char *s, stbtt_fontinfo *buffer, int height) |
17 | dword get_width = #att_get_width; // get_width_utf8(unsigned char *s, stbtt_fontinfo *buffer, int height) |
9 | dword text_out = #att_text_out; // text_out(unsigned char *string, char *buffer, int height, int color,int back_color, int x, int y) |
18 | dword text_out = #att_text_out; // text_out(unsigned char *string, char *buffer, int height, int color,int back_color, int x, int y) |
10 | dword init_font = #att_init_font; // init_font(stbtt_fontinfo *font,unsigned char *FontData) |
19 | dword init_font = #att_init_font; // init_font(stbtt_fontinfo *font,unsigned char *FontData) |
11 | dword text_out_mem = #att_text_out_mem; // text_out_mem(unsigned char *string, stbtt_fontinfo *buffer, int height, int color,int back_color) |
20 | dword text_out_mem = #att_text_out_mem; // text_out_mem(unsigned char *string, stbtt_fontinfo *buffer, int height, int color,int back_color) |
12 | $DD 2 dup 0 |
21 | $DD 2 dup 0 |
13 | 22 | ||
14 | char att_truetype[] = "truetype"; |
23 | char att_truetype[] = "truetype"; |
15 | char att_get_length[] = "get_length"; |
24 | char att_get_length[] = "get_length"; |
16 | char att_get_width[] = "get_width"; |
25 | char att_get_width[] = "get_width"; |
17 | char att_text_out[] = "text_out"; |
26 | char att_text_out[] = "text_out"; |
18 | char att_text_out_mem[] = "text_out_mem"; |
27 | char att_text_out_mem[] = "text_out_mem"; |
19 | char att_init_font[] = "init_font"; |
28 | char att_init_font[] = "init_font"; |
20 | 29 | ||
21 | //============================================================ |
30 | //============================================================ |
22 | //============================================================ |
31 | //============================================================ |
23 | 32 | ||
24 | char fontinfo[28]; |
33 | char fontinfo[28]; |
25 | 34 | ||
26 | struct stbtt_fontinfo |
35 | struct stbtt_fontinfo |
27 | { |
36 | { |
28 | dword userdata; |
37 | dword userdata; |
29 | dword data; // pointer to .ttf file |
38 | dword data; // pointer to .ttf file |
30 | int fontstart; // offset of start of font |
39 | int fontstart; // offset of start of font |
31 | 40 | ||
32 | int numGlyphs; // number of glyphs, needed for range checking |
41 | int numGlyphs; // number of glyphs, needed for range checking |
33 | 42 | ||
34 | int loca,head,glyf,hhea,hmtx,kern; // table locations as offset from start of .ttf |
43 | int loca,head,glyf,hhea,hmtx,kern; // table locations as offset from start of .ttf |
35 | int index_map; // a cmap mapping for our chosen character encoding |
44 | int index_map; // a cmap mapping for our chosen character encoding |
36 | int indexToLocFormat; // format needed to map from glyph index to glyph |
45 | int indexToLocFormat; // format needed to map from glyph index to glyph |
37 | }; |
46 | }; |
- | 47 | ||
- | 48 | #endif |
|
38 | 49 |