Commit 2474f613 authored by Salah-Eddin Shaban's avatar Salah-Eddin Shaban Committed by Jean-Baptiste Kempf

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

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 9be4f7e0b5e289015f64508c8321d84c6abecd04)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 6992e73f
...@@ -1360,6 +1360,12 @@ static int ProcessLines( filter_t *p_filter, ...@@ -1360,6 +1360,12 @@ static int ProcessLines( filter_t *p_filter,
uni_char_t character = psz_text[i_index]; uni_char_t character = psz_text[i_index];
int i_glyph_index = FT_Get_Char_Index( p_current_face, character ); 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 */ /* Get kerning vector */
FT_Vector kerning = { .x = 0, .y = 0 }; FT_Vector kerning = { .x = 0, .y = 0 };
if( FT_HAS_KERNING( p_current_face ) && i_glyph_last != 0 && i_glyph_index != 0 ) if( FT_HAS_KERNING( p_current_face ) && i_glyph_last != 0 && i_glyph_index != 0 )
......
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