2 * This file is part of MPlayer.
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.
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.
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.
19 #ifndef MPLAYER_FONT_LOAD_H
20 #define MPLAYER_FONT_LOAD_H
24 #ifdef CONFIG_FREETYPE
26 #include FT_FREETYPE_H
33 #ifdef CONFIG_FREETYPE
34 int charwidth
,charheight
,pen
,baseline
,padding
;
35 int current_count
, current_alloc
;
39 typedef struct font_desc
{
40 #ifdef CONFIG_FREETYPE
53 int start
[65536]; // short is not enough for unicode fonts
57 #ifdef CONFIG_FREETYPE
61 FT_UInt glyph_index
[65536];
63 int max_width
, max_height
;
84 extern font_desc_t
* vo_font
;
86 extern char *subtitle_font_encoding
;
87 extern float text_font_scale_factor
;
88 extern float osd_font_scale_factor
;
89 extern float subtitle_font_radius
;
90 extern float subtitle_font_thickness
;
91 extern int subtitle_autoscale
;
93 extern int vo_image_width
;
94 extern int vo_image_height
;
96 extern int force_load_font
;
98 int init_freetype(void);
99 int done_freetype(void);
101 font_desc_t
* read_font_desc_ft(const char* fname
,int face_index
,int movie_width
, int movie_height
, float font_scale_factor
);
102 void free_font_desc(font_desc_t
*desc
);
104 void render_one_glyph(font_desc_t
*desc
, int c
);
105 int kerning(font_desc_t
*desc
, int prevc
, int c
);
107 void load_font_ft(int width
, int height
, font_desc_t
**desc
, const char *name
, float font_scale_factor
);
109 void blur(unsigned char *buffer
, unsigned short *tmp2
, int width
, int height
,
110 int stride
, int *m2
, int r
, int mwidth
);
112 raw_file
* load_raw(char *name
,int verbose
);
113 font_desc_t
* read_font_desc(const char* fname
,float factor
,int verbose
);
115 #endif /* MPLAYER_FONT_LOAD_H */