increase max glyph and lines limit
[mplayer/glamo.git] / libvo / font_load.h
blob532476e6d65212a19a1334774a21778fbaa3e4fe
1 #ifndef MPLAYER_FONT_LOAD_H
2 #define MPLAYER_FONT_LOAD_H
4 #ifdef CONFIG_FREETYPE
5 #include <ft2build.h>
6 #include FT_FREETYPE_H
7 #endif
9 typedef struct {
10 unsigned char *bmp;
11 unsigned char *pal;
12 int w,h,c;
13 #ifdef CONFIG_FREETYPE
14 int charwidth,charheight,pen,baseline,padding;
15 int current_count, current_alloc;
16 #endif
17 } raw_file;
19 typedef struct font_desc {
20 #ifdef CONFIG_FREETYPE
21 int dynamic;
22 #endif
23 char *name;
24 char *fpath;
25 int spacewidth;
26 int charspace;
27 int height;
28 // char *fname_a;
29 // char *fname_b;
30 raw_file* pic_a[16];
31 raw_file* pic_b[16];
32 short font[65536];
33 int start[65536]; // short is not enough for unicode fonts
34 short width[65536];
35 int freetype;
37 #ifdef CONFIG_FREETYPE
38 int face_cnt;
40 FT_Face faces[16];
41 FT_UInt glyph_index[65536];
43 int max_width, max_height;
45 struct
47 int g_r;
48 int o_r;
49 int g_w;
50 int o_w;
51 int o_size;
52 unsigned volume;
54 unsigned *g;
55 unsigned *gt2;
56 unsigned *om;
57 unsigned char *omt;
58 unsigned short *tmp;
59 } tables;
60 #endif
62 } font_desc_t;
64 extern font_desc_t* vo_font;
65 extern font_desc_t* sub_font;
67 extern char *subtitle_font_encoding;
68 extern float text_font_scale_factor;
69 extern float osd_font_scale_factor;
70 extern float subtitle_font_radius;
71 extern float subtitle_font_thickness;
72 extern int subtitle_autoscale;
74 extern int vo_image_width;
75 extern int vo_image_height;
77 extern int force_load_font;
79 int init_freetype(void);
80 int done_freetype(void);
82 font_desc_t* read_font_desc_ft(const char* fname,int face_index,int movie_width, int movie_height, float font_scale_factor);
83 void free_font_desc(font_desc_t *desc);
85 void render_one_glyph(font_desc_t *desc, int c);
86 int kerning(font_desc_t *desc, int prevc, int c);
88 void load_font_ft(int width, int height, font_desc_t **desc, const char *name, float font_scale_factor);
90 void blur(unsigned char *buffer, unsigned short *tmp2, int width, int height,
91 int stride, int *m2, int r, int mwidth);
93 raw_file* load_raw(char *name,int verbose);
94 font_desc_t* read_font_desc(const char* fname,float factor,int verbose);
96 #endif /* MPLAYER_FONT_LOAD_H */