Merge svn changes up to r28310
[mplayer/glamo.git] / libvo / font_load.h
blob6bb4a175e3c392b5b93bb6ff59e916ba1af240d0
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;
66 extern char *subtitle_font_encoding;
67 extern float text_font_scale_factor;
68 extern float osd_font_scale_factor;
69 extern float subtitle_font_radius;
70 extern float subtitle_font_thickness;
71 extern int subtitle_autoscale;
73 extern int vo_image_width;
74 extern int vo_image_height;
76 extern int force_load_font;
78 int init_freetype(void);
79 int done_freetype(void);
81 font_desc_t* read_font_desc_ft(const char* fname,int face_index,int movie_width, int movie_height, float font_scale_factor);
82 void free_font_desc(font_desc_t *desc);
84 void render_one_glyph(font_desc_t *desc, int c);
85 int kerning(font_desc_t *desc, int prevc, int c);
87 void load_font_ft(int width, int height, font_desc_t **desc, const char *name, float font_scale_factor);
89 void blur(unsigned char *buffer, unsigned short *tmp2, int width, int height,
90 int stride, int *m2, int r, int mwidth);
92 raw_file* load_raw(char *name,int verbose);
93 font_desc_t* read_font_desc(const char* fname,float factor,int verbose);
95 #endif /* MPLAYER_FONT_LOAD_H */