diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-29 14:59:23 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-29 14:59:23 +0000 |
commit | c8b0ddfe4e1570b83b815a3c9befced24e4d2875 (patch) | |
tree | d0e864e177b24d068bea47f15a911d16a252ddc3 /libvo/font_load_ft.c | |
parent | 7e26b6cc29c1f050f55152f0759cd2db276d107e (diff) | |
download | mpv-c8b0ddfe4e1570b83b815a3c9befced24e4d2875.tar.bz2 mpv-c8b0ddfe4e1570b83b815a3c9befced24e4d2875.tar.xz |
these patches let ,,oldstyle'' and freetype subtitle renderers live
together happily. if an oldstyle subtitle (font.desc) is found, it will
be used. otherwise mplayer will choose subfont.ttf, if freetype was
detected during ./configure.
(also you can use -font /path/to/font.desc and -font /path/to/foobar.ttf too)
patch-set by Wojtek Kaniewski <wojtekka@bydg.pdi.net>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8636 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/font_load_ft.c')
-rw-r--r-- | libvo/font_load_ft.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index b829f6d00e..398e78b5a7 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -50,6 +50,8 @@ int vo_image_width = 0; int vo_image_height = 0; int force_load_font; +int using_freetype = 0; + //// constants static unsigned int const colors = 256; static unsigned int const maxcolor = 255; @@ -937,7 +939,7 @@ int kerning(font_desc_t *desc, int prevc, int c) return f266ToInt(kern.x); } -font_desc_t* read_font_desc(char *fname, int movie_width, int movie_height) +font_desc_t* read_font_desc_ft(char *fname, int movie_width, int movie_height) { font_desc_t *desc; @@ -1086,12 +1088,16 @@ int init_freetype() return -1; } fprintf(stderr, "init_freetype\n"); + using_freetype = 1; return 0; } int done_freetype() { int err; + + if (!using_freetype) + return 0; err = FT_Done_FreeType(library); if (err) { @@ -1102,7 +1108,7 @@ int done_freetype() return 0; } -void load_font(int width, int height) +void load_font_ft(int width, int height) { vo_image_width = width; vo_image_height = height; @@ -1113,7 +1119,7 @@ void load_font(int width, int height) if (vo_font) free_font_desc(vo_font); #ifdef USE_OSD - vo_font=read_font_desc(font_name, width, height); + vo_font=read_font_desc_ft(font_name, width, height); #endif } |