[vlc-commits] text_renderer: workaround max y size limit
Francois Cartegnie
git at videolan.org
Fri Dec 22 20:07:02 CET 2017
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 21 20:49:31 2017 +0100| [72b5e60fc5e343c73ef340e7ecd004fff8083e32] | committer: Jean-Baptiste Kempf
text_renderer: workaround max y size limit
because computed regions size usually do not
match the real line size.
(the right fix being to know font metrics
before our renderers)
refs #19230
(cherry picked from commit 42584bd48ba1b91aba6cfdab51f1b9a85773fbc0)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=72b5e60fc5e343c73ef340e7ecd004fff8083e32
---
modules/text_renderer/freetype/text_layout.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
index d6844b23d0..0761ef3cbe 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -1553,7 +1553,8 @@ int LayoutText( filter_t *p_filter,
for( ; *pp_line; pp_line = &(*pp_line)->p_next )
{
- i_total_height += (*pp_line)->i_height;
+ /* only cut at max i_max_height + 1 line due to
+ * approximate font sizing vs region size */
if( i_max_height > 0 && i_total_height > i_max_height )
{
i_total_height = i_max_height + 1;
@@ -1572,6 +1573,7 @@ int LayoutText( filter_t *p_filter,
{
i_max_face_height = (*pp_line)->i_height;
}
+ i_total_height += (*pp_line)->i_height;
}
i_paragraph_start = i + 1;
}
More information about the vlc-commits
mailing list