[vlc-commits] freetype: fix strikeout style corruption

Francois Cartegnie git at videolan.org
Fri Aug 21 00:42:26 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Aug 20 22:23:40 2015 +0200| [e124678ed8d935622a038be0d49c3c27332a32f8] | committer: Francois Cartegnie

freetype: fix strikeout style corruption

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

 modules/text_renderer/freetype.c    |    2 +-
 modules/text_renderer/text_layout.c |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 25e218c..361ddfc 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -845,7 +845,7 @@ static inline int RenderAXYZ( filter_t *p_filter,
                                 BlendPixel );
 
                 /* underline/strikethrough are only rendered for the normal glyph */
-                if( g == 2 && ch->i_line_thickness > 0 )
+                if( g == 2 && ch->i_line_thickness > 0 && p_glyph->bitmap.rows )
                     BlendAXYZLine( p_picture,
                                    i_glyph_x, i_glyph_y + p_glyph->top,
                                    i_a, i_x, i_y, i_z,
diff --git a/modules/text_renderer/text_layout.c b/modules/text_renderer/text_layout.c
index 0ebc3ad..3493663 100644
--- a/modules/text_renderer/text_layout.c
+++ b/modules/text_renderer/text_layout.c
@@ -1021,6 +1021,12 @@ static int LayoutLine( filter_t *p_filter,
                 i_line_offset -=
                     abs( FT_FLOOR( FT_MulFix( p_face->descender * 2,
                                               p_face->size->metrics.y_scale ) ) );
+                p_bitmaps->glyph_bbox.yMax =
+                    __MAX( p_bitmaps->glyph_bbox.yMax,
+                           - i_line_offset );
+                p_bitmaps->glyph_bbox.yMin =
+                    __MIN( p_bitmaps->glyph_bbox.yMin,
+                           i_line_offset - i_line_thickness );
             }
             else if( i_line_thickness > 0 )
             {



More information about the vlc-commits mailing list