Commit 77b78f49 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

codec: substext: rebase font size px as % of video size

parent f03f900c
......@@ -233,12 +233,12 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
if( p_segment->style )
{
/* Update all segments font sizes in pixels, *** metric used by renderers *** */
/* We only do this when a fixed font size isn't set */
if( p_segment->style && p_segment->style->f_font_relsize && !p_segment->style->i_font_size )
/* Update all segments font sizes in video source %,
* so we can handle HiDPI properly and have consistent rendering limits */
if( p_segment->style->i_font_size > 0 && fmt_src->i_visible_height > 0 )
{
p_segment->style->i_font_size = p_segment->style->f_font_relsize *
subpic->i_original_picture_height / 100;
p_segment->style->f_font_relsize = 100.0 * p_segment->style->i_font_size / fmt_src->i_visible_height;
p_segment->style->i_font_size = 0;
}
if( p_segment->style->i_style_flags & (STYLE_BLINK_BACKGROUND|STYLE_BLINK_FOREGROUND) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment