diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-27 15:14:02 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-27 15:14:02 +0000 |
commit | fbae3928cddfcb459445f105daac12b42f2991ba (patch) | |
tree | 2dfd8834e7f3e93478b3fa655fe28f6b7548b3c7 | |
parent | 131683f8f35aed3145af816e8ea3dea3c6f4bd31 (diff) |
Allow independent scaling of vo_font and sub_font.
Patch by Guillaume LECERF (foxcore gmail com).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25879 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | gui/interface.c | 2 | ||||
-rw-r--r-- | libmenu/vf_menu.c | 2 | ||||
-rw-r--r-- | libvo/font_load.h | 4 | ||||
-rw-r--r-- | libvo/font_load_ft.c | 12 | ||||
-rw-r--r-- | libvo/sub.c | 12 |
5 files changed, 16 insertions, 16 deletions
diff --git a/gui/interface.c b/gui/interface.c index 283a83816b..479804cba5 100644 --- a/gui/interface.c +++ b/gui/interface.c @@ -384,7 +384,7 @@ extern m_obj_settings_t * vf_settings; void guiLoadFont( void ) { #ifdef HAVE_FREETYPE - load_font_ft(vo_image_width, vo_image_height, &vo_font, font_name); + load_font_ft(vo_image_width, vo_image_height, &vo_font, font_name, osd_font_scale_factor); #else if ( vo_font ) { diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c index bf11507d89..b2ba92ee58 100644 --- a/libmenu/vf_menu.c +++ b/libmenu/vf_menu.c @@ -206,7 +206,7 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width, // here is the right place to get screen dimensions if (force_load_font) { force_load_font = 0; - load_font_ft(width,height,&vo_font,font_name); + load_font_ft(width,height,&vo_font,font_name,osd_font_scale_factor); } #endif if(outfmt == IMGFMT_MPEGPES) diff --git a/libvo/font_load.h b/libvo/font_load.h index 08a3c47d15..0c7fe42890 100644 --- a/libvo/font_load.h +++ b/libvo/font_load.h @@ -81,13 +81,13 @@ extern int force_load_font; int init_freetype(void); int done_freetype(void); -font_desc_t* read_font_desc_ft(const char* fname,int movie_width, int movie_height); +font_desc_t* read_font_desc_ft(const char* fname,int movie_width, int movie_height, float font_scale_factor); 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_ft(int width, int height, font_desc_t **desc, const char *name); +void load_font_ft(int width, int height, font_desc_t **desc, const char *name, float font_scale_factor); void blur(unsigned char *buffer, unsigned short *tmp2, int width, int height, int stride, int *m2, int r, int mwidth); diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index 9b4f1d8adb..96eaa8f354 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -940,7 +940,7 @@ int kerning(font_desc_t *desc, int prevc, int c) return f266ToInt(kern.x); } -font_desc_t* read_font_desc_ft(const char *fname, int movie_width, int movie_height) +font_desc_t* read_font_desc_ft(const char *fname, int movie_width, int movie_height, float font_scale_factor) { font_desc_t *desc = NULL; @@ -980,8 +980,8 @@ font_desc_t* read_font_desc_ft(const char *fname, int movie_width, int movie_hei break; } - subtitle_font_ppem = movie_size*text_font_scale_factor/100.0; - osd_font_ppem = movie_size*osd_font_scale_factor/100.0; + subtitle_font_ppem = movie_size*font_scale_factor/100.0; + osd_font_ppem = movie_size*(font_scale_factor+1)/100.0; if (subtitle_font_ppem < 5) subtitle_font_ppem = 5; if (osd_font_ppem < 5) osd_font_ppem = 5; @@ -1122,7 +1122,7 @@ int done_freetype(void) return 0; } -void load_font_ft(int width, int height, font_desc_t** fontp, const char *font_name) +void load_font_ft(int width, int height, font_desc_t** fontp, const char *font_name, float font_scale_factor) { #ifdef HAVE_FONTCONFIG FcPattern *fc_pattern; @@ -1163,10 +1163,10 @@ void load_font_ft(int width, int height, font_desc_t** fontp, const char *font_n } // s doesn't need to be freed according to fontconfig docs FcPatternGetString(fc_pattern, FC_FILE, 0, &s); - *fontp=read_font_desc_ft(s, width, height); + *fontp=read_font_desc_ft(s, width, height, font_scale_factor); FcPatternDestroy(fc_pattern); } else #endif - *fontp=read_font_desc_ft(font_name, width, height); + *fontp=read_font_desc_ft(font_name, width, height, font_scale_factor); } diff --git a/libvo/sub.c b/libvo/sub.c index 2a7d4a4a96..aeb68d216b 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -1090,22 +1090,22 @@ int vo_update_osd(int dxs,int dys){ if (force_load_font) { force_load_font = 0; - load_font_ft(dxs, dys, &vo_font, font_name); + load_font_ft(dxs, dys, &vo_font, font_name, osd_font_scale_factor); if (sub_font_name) - load_font_ft(dxs, dys, &sub_font, sub_font_name); + load_font_ft(dxs, dys, &sub_font, sub_font_name, text_font_scale_factor); else - sub_font = vo_font; + load_font_ft(dxs, dys, &sub_font, font_name, text_font_scale_factor); prev_dxs = dxs; prev_dys = dys; defer_counter = 0; } else { if (!vo_font) - load_font_ft(dxs, dys, &vo_font, font_name); + load_font_ft(dxs, dys, &vo_font, font_name, osd_font_scale_factor); if (!sub_font) { if (sub_font_name) - load_font_ft(dxs, dys, &sub_font, sub_font_name); + load_font_ft(dxs, dys, &sub_font, sub_font_name, text_font_scale_factor); else - sub_font = vo_font; + load_font_ft(dxs, dys, &sub_font, font_name, text_font_scale_factor); } } #endif |