2002-08-28 20:52:02 +00:00
|
|
|
#ifndef __MPLAYER_FONT_LOAD_H
|
|
|
|
#define __MPLAYER_FONT_LOAD_H
|
|
|
|
|
|
|
|
#ifdef HAVE_FREETYPE
|
2003-11-20 16:25:40 +00:00
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
2002-08-28 20:52:02 +00:00
|
|
|
#endif
|
2001-03-25 04:28:40 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned char *bmp;
|
|
|
|
unsigned char *pal;
|
|
|
|
int w,h,c;
|
2002-08-28 20:52:02 +00:00
|
|
|
#ifdef HAVE_FREETYPE
|
|
|
|
int charwidth,charheight,pen,baseline,padding;
|
|
|
|
int current_count, current_alloc;
|
|
|
|
#endif
|
2001-03-25 04:28:40 +00:00
|
|
|
} raw_file;
|
|
|
|
|
|
|
|
typedef struct {
|
2002-08-29 17:35:21 +00:00
|
|
|
#ifdef HAVE_FREETYPE
|
|
|
|
int dynamic;
|
|
|
|
#endif
|
2001-03-25 19:10:52 +00:00
|
|
|
char *name;
|
2001-07-20 00:01:09 +00:00
|
|
|
char *fpath;
|
2001-03-25 04:28:40 +00:00
|
|
|
int spacewidth;
|
|
|
|
int charspace;
|
|
|
|
int height;
|
|
|
|
// char *fname_a;
|
|
|
|
// char *fname_b;
|
|
|
|
raw_file* pic_a[16];
|
|
|
|
raw_file* pic_b[16];
|
2001-05-06 02:26:17 +00:00
|
|
|
short font[65536];
|
2002-05-02 01:56:28 +00:00
|
|
|
int start[65536]; // short is not enough for unicode fonts
|
2001-05-06 02:26:17 +00:00
|
|
|
short width[65536];
|
2002-12-29 14:59:23 +00:00
|
|
|
int freetype;
|
2002-08-28 20:52:02 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_FREETYPE
|
|
|
|
int face_cnt;
|
|
|
|
|
|
|
|
FT_Face faces[16];
|
|
|
|
FT_UInt glyph_index[65536];
|
|
|
|
|
|
|
|
int max_width, max_height;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int g_r;
|
|
|
|
int o_r;
|
|
|
|
int g_w;
|
|
|
|
int o_w;
|
|
|
|
int o_size;
|
|
|
|
unsigned volume;
|
|
|
|
|
|
|
|
unsigned *g;
|
|
|
|
unsigned *gt2;
|
|
|
|
unsigned *om;
|
|
|
|
unsigned char *omt;
|
|
|
|
unsigned short *tmp;
|
|
|
|
} tables;
|
|
|
|
#endif
|
|
|
|
|
2001-03-25 04:28:40 +00:00
|
|
|
} font_desc_t;
|
|
|
|
|
2002-03-24 00:32:13 +00:00
|
|
|
extern font_desc_t* vo_font;
|
|
|
|
|
2002-08-28 20:52:02 +00:00
|
|
|
#ifdef HAVE_FREETYPE
|
|
|
|
|
|
|
|
extern char *subtitle_font_encoding;
|
|
|
|
extern float text_font_scale_factor;
|
|
|
|
extern float osd_font_scale_factor;
|
|
|
|
extern float subtitle_font_radius;
|
|
|
|
extern float subtitle_font_thickness;
|
|
|
|
extern int subtitle_autoscale;
|
|
|
|
|
|
|
|
extern int vo_image_width;
|
|
|
|
extern int vo_image_height;
|
|
|
|
|
|
|
|
extern int force_load_font;
|
|
|
|
|
2006-02-09 14:08:03 +00:00
|
|
|
int init_freetype(void);
|
|
|
|
int done_freetype(void);
|
2002-08-28 20:52:02 +00:00
|
|
|
|
2006-07-09 17:45:36 +00:00
|
|
|
font_desc_t* read_font_desc_ft(const char* fname,int movie_width, int movie_height);
|
2002-08-28 20:52:02 +00:00
|
|
|
void free_font_desc(font_desc_t *desc);
|
|
|
|
|
|
|
|
void render_one_glyph(font_desc_t *desc, int c);
|
|
|
|
int kerning(font_desc_t *desc, int prevc, int c);
|
|
|
|
|
2002-12-29 14:59:23 +00:00
|
|
|
void load_font_ft(int width, int height);
|
2002-08-28 20:52:02 +00:00
|
|
|
|
2006-09-16 13:32:19 +00:00
|
|
|
void blur(unsigned char *buffer, unsigned short *tmp2, int width, int height,
|
|
|
|
int stride, int *m2, int r, int mwidth);
|
|
|
|
|
2002-08-28 20:52:02 +00:00
|
|
|
#else
|
|
|
|
|
2002-12-29 14:59:23 +00:00
|
|
|
static void render_one_glyph(font_desc_t *desc, int c) {}
|
|
|
|
static int kerning(font_desc_t *desc, int prevc, int c) { return 0; }
|
2002-08-28 20:52:02 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2002-12-29 14:59:23 +00:00
|
|
|
raw_file* load_raw(char *name,int verbose);
|
2006-07-09 17:45:36 +00:00
|
|
|
font_desc_t* read_font_desc(const char* fname,float factor,int verbose);
|
2002-12-29 14:59:23 +00:00
|
|
|
|
2002-08-28 20:52:02 +00:00
|
|
|
#endif /* ! __MPLAYER_FONT_LOAD_H */
|