Mercurial > mplayer.hg
comparison sub/font_load.h @ 32466:9e627a1793b1
Move font_load.[ch], font_load_ft.c and osd_font.h from libvo to sub.
author | cigaes |
---|---|
date | Wed, 27 Oct 2010 17:37:29 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
32465:f8ee6f90f571 | 32466:9e627a1793b1 |
---|---|
1 /* | |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
18 | |
19 #ifndef MPLAYER_FONT_LOAD_H | |
20 #define MPLAYER_FONT_LOAD_H | |
21 | |
22 #include "config.h" | |
23 | |
24 #ifdef CONFIG_FREETYPE | |
25 #include <ft2build.h> | |
26 #include FT_FREETYPE_H | |
27 #endif | |
28 | |
29 typedef struct { | |
30 unsigned char *bmp; | |
31 unsigned char *pal; | |
32 int w,h,c; | |
33 #ifdef CONFIG_FREETYPE | |
34 int charwidth,charheight,pen,baseline,padding; | |
35 int current_count, current_alloc; | |
36 #endif | |
37 } raw_file; | |
38 | |
39 typedef struct font_desc { | |
40 #ifdef CONFIG_FREETYPE | |
41 int dynamic; | |
42 #endif | |
43 char *name; | |
44 char *fpath; | |
45 int spacewidth; | |
46 int charspace; | |
47 int height; | |
48 // char *fname_a; | |
49 // char *fname_b; | |
50 raw_file* pic_a[16]; | |
51 raw_file* pic_b[16]; | |
52 short font[65536]; | |
53 int start[65536]; // short is not enough for unicode fonts | |
54 short width[65536]; | |
55 int freetype; | |
56 | |
57 #ifdef CONFIG_FREETYPE | |
58 int face_cnt; | |
59 | |
60 FT_Face faces[16]; | |
61 FT_UInt glyph_index[65536]; | |
62 | |
63 int max_width, max_height; | |
64 | |
65 struct | |
66 { | |
67 int g_r; | |
68 int o_r; | |
69 int g_w; | |
70 int o_w; | |
71 int o_size; | |
72 unsigned volume; | |
73 | |
74 unsigned *g; | |
75 unsigned *gt2; | |
76 unsigned *om; | |
77 unsigned char *omt; | |
78 unsigned short *tmp; | |
79 } tables; | |
80 #endif | |
81 | |
82 } font_desc_t; | |
83 | |
84 extern font_desc_t* vo_font; | |
85 extern font_desc_t* sub_font; | |
86 | |
87 extern char *subtitle_font_encoding; | |
88 extern float text_font_scale_factor; | |
89 extern float osd_font_scale_factor; | |
90 extern float subtitle_font_radius; | |
91 extern float subtitle_font_thickness; | |
92 extern int subtitle_autoscale; | |
93 | |
94 extern int vo_image_width; | |
95 extern int vo_image_height; | |
96 | |
97 extern int font_fontconfig; | |
98 extern int force_load_font; | |
99 | |
100 int init_freetype(void); | |
101 int done_freetype(void); | |
102 | |
103 font_desc_t* read_font_desc_ft(const char* fname,int face_index,int movie_width, int movie_height, float font_scale_factor); | |
104 void free_font_desc(font_desc_t *desc); | |
105 | |
106 void render_one_glyph(font_desc_t *desc, int c); | |
107 int kerning(font_desc_t *desc, int prevc, int c); | |
108 | |
109 void load_font_ft(int width, int height, font_desc_t **desc, const char *name, float font_scale_factor); | |
110 | |
111 void blur(unsigned char *buffer, unsigned short *tmp2, int width, int height, | |
112 int stride, int *m2, int r, int mwidth); | |
113 | |
114 raw_file* load_raw(char *name,int verbose); | |
115 font_desc_t* read_font_desc(const char* fname,float factor,int verbose); | |
116 | |
117 #endif /* MPLAYER_FONT_LOAD_H */ |