summaryrefslogtreecommitdiffstats
path: root/libvo/font_load.h
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-28 20:52:02 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-28 20:52:02 +0000
commitfd44bbee3de65f95bdd9e5108b17277f1cac3d59 (patch)
tree4652fa878c4ee165fbea28d8d59abdcb3cfbabdc /libvo/font_load.h
parent5e59ee334476b6fa1b557cb87d1dca8be24e02c3 (diff)
downloadmpv-fd44bbee3de65f95bdd9e5108b17277f1cac3d59.tar.bz2
mpv-fd44bbee3de65f95bdd9e5108b17277f1cac3d59.tar.xz
freetype 2.0/2.1+ support - disabled by default until bugs fixed
patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7123 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/font_load.h')
-rw-r--r--libvo/font_load.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/libvo/font_load.h b/libvo/font_load.h
index 6e144d5926..594aaaf10b 100644
--- a/libvo/font_load.h
+++ b/libvo/font_load.h
@@ -1,8 +1,18 @@
+#ifndef __MPLAYER_FONT_LOAD_H
+#define __MPLAYER_FONT_LOAD_H
+
+#ifdef HAVE_FREETYPE
+#include <freetype/freetype.h>
+#endif
typedef struct {
unsigned char *bmp;
unsigned char *pal;
int w,h,c;
+#ifdef HAVE_FREETYPE
+ int charwidth,charheight,pen,baseline,padding;
+ int current_count, current_alloc;
+#endif
} raw_file;
typedef struct {
@@ -18,9 +28,80 @@ typedef struct {
short font[65536];
int start[65536]; // short is not enough for unicode fonts
short width[65536];
+
+#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 *gt;
+ unsigned *gt2;
+ unsigned *om;
+ unsigned char *omt;
+ unsigned short *tmp;
+ } tables;
+#endif
+
} font_desc_t;
extern font_desc_t* vo_font;
+#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();
+
+font_desc_t* read_font_desc(char* fname,float factor,int movie_width, int movie_height);
+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
+
raw_file* load_raw(char *name,int verbose);
font_desc_t* read_font_desc(char* fname,float factor,int verbose);
+
+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)
+{
+}
+
+#endif
+
+#endif /* ! __MPLAYER_FONT_LOAD_H */