Skip to content
Snippets Groups Projects
Commit aed678eb authored by Steve Lhomme's avatar Steve Lhomme
Browse files

freetype: avoid very large fonts in portrait mode

Either when the video is in portrait mode or when the subtitles
are shown in the black bars and the video area is in portrait mode,
the text can become very large just because we apply a percentage base on
the output height.

We switch mode when the height becomes bigger than the width
so there's a continuity in the ratio when growing/shrinking the
video in one direction or the other.

(cherry picked from commit e25ec4e2)
parent d2aa5898
No related branches found
No related tags found
1 merge request!6965[3.0] freetype: avoid very large fonts in portrait mode
Pipeline #573210 passed with stages
in 18 minutes and 9 seconds
......@@ -464,7 +464,11 @@ 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 / 100;
unsigned area_height = p_filter->fmt_out.video.i_height;
if (p_filter->fmt_out.video.i_height > p_filter->fmt_out.video.i_width )
// portrait mode leads to very large text
area_height = p_filter->fmt_out.video.i_width;
i_font_size = (int) area_height * p_style->f_font_relsize / 100;
}
if( p_sys->i_scale != 100 )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment