[vlc-commits] text_renderer: freetype: fix forced relative font sizing unit

Francois Cartegnie git at videolan.org
Sun Dec 31 21:59:30 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 28 11:40:27 2017 +0100| [ab7a70c7ffd119e88e354ddedd72a117b9fe3071] | committer: Francois Cartegnie

text_renderer: freetype: fix forced relative font sizing unit

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ab7a70c7ffd119e88e354ddedd72a117b9fe3071
---

 modules/text_renderer/freetype/freetype.c       | 2 +-
 modules/text_renderer/freetype/platform_fonts.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index b7e4823e38..2595ef3872 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -996,7 +996,7 @@ static void FillDefaultStyles( filter_t *p_filter )
     p_sys->p_forced_style->i_font_size = var_InheritInteger( p_filter, "freetype-fontsize" );
     p_sys->p_forced_style->f_font_relsize = var_InheritInteger( p_filter, "freetype-rel-fontsize" );
     if( p_sys->p_forced_style->f_font_relsize )
-        p_sys->p_forced_style->f_font_relsize = 1.0 / p_sys->p_forced_style->f_font_relsize;
+        p_sys->p_forced_style->f_font_relsize = 100.0 / p_sys->p_forced_style->f_font_relsize;
 
     if( var_InheritBool( p_filter, "freetype-bold" ) )
     {
diff --git a/modules/text_renderer/freetype/platform_fonts.c b/modules/text_renderer/freetype/platform_fonts.c
index 943d4c6112..53c94d1dcc 100644
--- a/modules/text_renderer/freetype/platform_fonts.c
+++ b/modules/text_renderer/freetype/platform_fonts.c
@@ -464,7 +464,7 @@ int ConvertToLiveSize( filter_t *p_filter, const text_style_t *p_style )
     }
     else if ( p_style->f_font_relsize )
     {
-        i_font_size = (int) p_filter->fmt_out.video.i_height * p_style->f_font_relsize;
+        i_font_size = (int) p_filter->fmt_out.video.i_height * p_style->f_font_relsize / 100;
     }
 
     if( p_sys->i_scale != 100 )



More information about the vlc-commits mailing list