[vlc-commits] text_renderer: workaround max y size limit

Francois Cartegnie git at videolan.org
Thu Dec 21 21:00:27 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 21 20:49:31 2017 +0100| [42584bd48ba1b91aba6cfdab51f1b9a85773fbc0] | committer: Francois Cartegnie

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=42584bd48ba1b91aba6cfdab51f1b9a85773fbc0
---

 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