2002-08-28 20:52:02 +00:00
|
|
|
#ifndef __MPLAYER_FONT_LOAD_H
|
|
|
|
#define __MPLAYER_FONT_LOAD_H
|
|
|
|
|
|
|
|
#ifdef HAVE_FREETYPE
|
|
|
|
#include <freetype/freetype.h>
|
|
|
|
#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-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;
|
|
|
|
|
|
|
|
int init_freetype();
|
|
|
|
int done_freetype();
|
|
|
|
|
2002-08-29 17:35:21 +00:00
|
|
|
font_desc_t* read_font_desc(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);
|
|
|
|
|
|
|
|
void load_font(int width, int height);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2001-04-11 00:47:05 +00:00
|
|
|
raw_file* load_raw(char *name,int verbose);
|
|
|
|
font_desc_t* read_font_desc(char* fname,float factor,int verbose);
|
2002-08-28 20:52:02 +00:00
|
|
|
|
2002-08-30 13:53:27 +00:00
|
|
|
static void inline render_one_glyph(font_desc_t *desc, int c) {}
|
|
|
|
static int inline kerning(font_desc_t *desc, int prevc, int c) { return 0; }
|
|
|
|
static void inline load_font(int width, int height){}
|
2002-08-28 20:52:02 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ! __MPLAYER_FONT_LOAD_H */
|