[vlc-commits] text_renderer: freetype: fix forced relative font sizing unit
Francois Cartegnie
git at videolan.org
Wed Jan 17 16:12:58 CET 2018
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 28 11:40:27 2017 +0100| [bf96d5a4bf3d8e0b16f7e92b4b7627d8875faf8d] | committer: Jean-Baptiste Kempf
text_renderer: freetype: fix forced relative font sizing unit
(cherry picked from commit ab7a70c7ffd119e88e354ddedd72a117b9fe3071)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=bf96d5a4bf3d8e0b16f7e92b4b7627d8875faf8d
---
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