vlc | branch: master | Salah-Eddin Shaban <[email protected]> | Mon Jan  5 
14:52:33 2015 +0000| [9be4f7e0b5e289015f64508c8321d84c6abecd04] | committer: 
Jean-Baptiste Kempf

freetype: fix extra squares in Arabic subtitles (fixes #6152 #8117)

Signed-off-by: Jean-Baptiste Kempf <[email protected]>

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

 modules/text_renderer/freetype.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index e562afc..1670aa7 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1367,6 +1367,12 @@ static int ProcessLines( filter_t *p_filter,
                 uni_char_t character = psz_text[i_index];
                 int i_glyph_index = FT_Get_Char_Index( p_current_face, 
character );
 
+                /* If the missing glyph is U+FEFF (ZERO WIDTH NO-BREAK SPACE) 
*/
+                /* we can safely ignore it. Otherwise extra squares show up   
*/
+                /* in Arabic text.                                            
*/
+                if( i_glyph_index == 0 && character == 0xFEFF )
+                    goto next;
+
                 /* Get kerning vector */
                 FT_Vector kerning = { .x = 0, .y = 0 };
                 if( FT_HAS_KERNING( p_current_face ) && i_glyph_last != 0 && 
i_glyph_index != 0 )

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to