[vlc-commits] [Git][videolan/vlc][master] freetype: avoid very large fonts in portrait mode
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Fri Feb 28 12:37:42 UTC 2025
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
e25ec4e2 by Steve Lhomme at 2025-02-28T12:22:40+00:00
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.
- - - - -
1 changed file:
- modules/text_renderer/freetype/platform_fonts.c
Changes:
=====================================
modules/text_renderer/freetype/platform_fonts.c
=====================================
@@ -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 )
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e25ec4e25be1f2620ec031d2ef7bf5a09809235d
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e25ec4e25be1f2620ec031d2ef7bf5a09809235d
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list