]> git.sesse.net Git - vlc/commitdiff
* hebrew line order fixes. patch by Barak Ori (barakori at gmail dot com) (closes...
authorDerk-Jan Hartman <hartman@videolan.org>
Sun, 11 Dec 2005 23:41:29 +0000 (23:41 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sun, 11 Dec 2005 23:41:29 +0000 (23:41 +0000)
THANKS
modules/misc/freetype.c

diff --git a/THANKS b/THANKS
index 2f6696fb3c3b0de0928d76c5e4fa868ebc608dd0..f69db14d58c2697034ff8ac4c0f6867f1a5050fe 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -18,6 +18,7 @@ Arkadiusz Lipiec <A.Lipiec at elka.pw.edu.pl> - Polish translation
 Arkadiusz Miskiewicz <misiek at pld.ORG.PL> - autoconf and Makefile patches
 Arnaud Gomes-do-Vale <arnaud at carrosse.frmug.org> - autoconf patches
 Arwed v. Merkatz <v.merkatz at gmx dot net> - Gamma correction for adjust filter
+Barak Ori <barakori at gmail dot com> - Bidi fixes
 Benjamin Mironer <bmironer at noos.fr> - Mac OS X fixes
 Benoit Steiner <benny at via.ecp.fr> - MPEG system input, network input
 Bill Eldridge <bill at rfa.org> - documentation
index 98fd7abba941ead2298a8e4e340b79ee2942ed06..321d3c9213f3676871bd89d4b16700a8ecc82ca7 100644 (file)
@@ -526,10 +526,34 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
 #if defined(HAVE_FRIBIDI)
     {
         uint32_t *p_fribidi_string;
-        FriBidiCharType base_dir = FRIBIDI_TYPE_ON;
         p_fribidi_string = malloc( (i_string_length + 1) * sizeof(uint32_t) );
-        fribidi_log2vis( (FriBidiChar*)psz_unicode, i_string_length,
-                         &base_dir, (FriBidiChar*)p_fribidi_string, 0, 0, 0 );
+
+               /* Do bidi conversion line-by-line */
+               int pos = 0;
+               while(pos < i_string_length) 
+               {
+                       while(pos < i_string_length) {
+                               i_char = psz_unicode[pos];
+                               if (i_char != '\r' && i_char != '\n')
+                                       break;
+                               p_fribidi_string[pos] = i_char;
+                               ++pos;
+                       }
+                       int start_pos = pos;
+                       while(pos < i_string_length) {
+                               i_char = psz_unicode[pos];
+                               if (i_char == '\r' || i_char == '\n')
+                                       break;
+                               ++pos;
+                       }
+                       if (pos > start_pos)
+                       {
+                       FriBidiCharType base_dir = FRIBIDI_TYPE_LTR;
+                               fribidi_log2vis((FriBidiChar*)psz_unicode + start_pos, pos - start_pos,
+                                       &base_dir, (FriBidiChar*)p_fribidi_string + start_pos, 0, 0, 0);
+                       }
+               }
+               
         free( psz_unicode_orig );
         psz_unicode = psz_unicode_orig = p_fribidi_string;
         p_fribidi_string[ i_string_length ] = 0;