1 /*******************************************************
2               LV Bitmap font interface
3 *******************************************************/
4 
5 #ifndef __LVFNTGEN_H_INCLUDED__
6 #define __LVFNTGEN_H_INCLUDED__
7 
8 #include "../../include/lvfnt.h"
9 
10 struct glyph_range_buf
11 {
12     tag_lvfont_range range;
13     unsigned char buf[0x10000];
14     int pos;
15     glyph_range_buf();
16 
getSizeglyph_range_buf17     int getSize() { return (sizeof(range) + pos + 7)/8*8; }
18 
19     lvfont_glyph_t * addGlyph( unsigned short code );
20 
21     void commitGlyph();
22 
isEmptyglyph_range_buf23     bool isEmpty() { return pos==0; }
24 };
25 
26 
27 struct font_gen_buf
28 {
29     lvfont_header_t   hdr;
30     glyph_range_buf * ranges[1024];
31     glyph_range_buf * lastRange;
32     hrle_decode_info_t * decodeTable;
33     int decodeTableSize;
34 
35     lvfont_glyph_t *  addGlyph( unsigned short code );
36     void commitGlyph();
37     void setDecodeTable( hrle_decode_info_t * table );
38 
39     bool saveToFile( const char * fname );
40     void init( int fntSize, int fntBaseline, int bitsPerPixel, const char * fontName, const char * fontCopyright );
41     font_gen_buf();
42     ~font_gen_buf();
43 };
44 
45 #endif
46