7122
|
1 #ifndef __MPLAYER_FONT_LOAD_H
|
|
2 #define __MPLAYER_FONT_LOAD_H
|
|
3
|
|
4 #ifdef HAVE_FREETYPE
|
11500
|
5 #include <ft2build.h>
|
|
6 #include FT_FREETYPE_H
|
7122
|
7 #endif
|
213
|
8
|
|
9 typedef struct {
|
|
10 unsigned char *bmp;
|
|
11 unsigned char *pal;
|
|
12 int w,h,c;
|
7122
|
13 #ifdef HAVE_FREETYPE
|
|
14 int charwidth,charheight,pen,baseline,padding;
|
|
15 int current_count, current_alloc;
|
|
16 #endif
|
213
|
17 } raw_file;
|
|
18
|
|
19 typedef struct {
|
7140
|
20 #ifdef HAVE_FREETYPE
|
|
21 int dynamic;
|
|
22 #endif
|
214
|
23 char *name;
|
1353
|
24 char *fpath;
|
213
|
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];
|
706
|
32 short font[65536];
|
5928
|
33 int start[65536]; // short is not enough for unicode fonts
|
706
|
34 short width[65536];
|
8635
|
35 int freetype;
|
7122
|
36
|
|
37 #ifdef HAVE_FREETYPE
|
|
38 int face_cnt;
|
|
39
|
|
40 FT_Face faces[16];
|
|
41 FT_UInt glyph_index[65536];
|
|
42
|
|
43 int max_width, max_height;
|
|
44
|
|
45 struct
|
|
46 {
|
|
47 int g_r;
|
|
48 int o_r;
|
|
49 int g_w;
|
|
50 int o_w;
|
|
51 int o_size;
|
|
52 unsigned volume;
|
|
53
|
|
54 unsigned *g;
|
|
55 unsigned *gt2;
|
|
56 unsigned *om;
|
|
57 unsigned char *omt;
|
|
58 unsigned short *tmp;
|
|
59 } tables;
|
|
60 #endif
|
|
61
|
213
|
62 } font_desc_t;
|
|
63
|
5294
|
64 extern font_desc_t* vo_font;
|
|
65
|
7122
|
66 #ifdef HAVE_FREETYPE
|
|
67
|
|
68 extern char *subtitle_font_encoding;
|
|
69 extern float text_font_scale_factor;
|
|
70 extern float osd_font_scale_factor;
|
|
71 extern float subtitle_font_radius;
|
|
72 extern float subtitle_font_thickness;
|
|
73 extern int subtitle_autoscale;
|
|
74
|
|
75 extern int vo_image_width;
|
|
76 extern int vo_image_height;
|
|
77
|
|
78 extern int force_load_font;
|
|
79
|
17566
|
80 int init_freetype(void);
|
|
81 int done_freetype(void);
|
7122
|
82
|
18980
ed69754aa58d
Marks several string parameters as const when they are not modified in the function, Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
diff
changeset
|
83 font_desc_t* read_font_desc_ft(const char* fname,int movie_width, int movie_height);
|
7122
|
84 void free_font_desc(font_desc_t *desc);
|
|
85
|
|
86 void render_one_glyph(font_desc_t *desc, int c);
|
|
87 int kerning(font_desc_t *desc, int prevc, int c);
|
|
88
|
8635
|
89 void load_font_ft(int width, int height);
|
7122
|
90
|
|
91 #else
|
|
92
|
8635
|
93 static void render_one_glyph(font_desc_t *desc, int c) {}
|
|
94 static int kerning(font_desc_t *desc, int prevc, int c) { return 0; }
|
|
95
|
|
96 #endif
|
|
97
|
339
|
98 raw_file* load_raw(char *name,int verbose);
|
18980
ed69754aa58d
Marks several string parameters as const when they are not modified in the function, Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
diff
changeset
|
99 font_desc_t* read_font_desc(const char* fname,float factor,int verbose);
|
7122
|
100
|
|
101 #endif /* ! __MPLAYER_FONT_LOAD_H */
|