Skip to content
Snippets Groups Projects
Commit e25ec4e2 authored by Steve Lhomme's avatar Steve Lhomme Committed by Felix Paul Kühne
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.
parent a344bc7e
No related branches found
No related tags found
1 merge request!6956freetype: avoid very large fonts in portrait mode
Pipeline #571671 passed with stage
in 30 minutes and 21 seconds
......@@ -554,7 +554,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