[vte] bidi: Disable Arabic ligatures



commit 0567e31bddeb02c45049aab42d146f90d7f455ca
Author: Egmont Koblinger <egmont gmail com>
Date:   Mon Jul 8 23:42:44 2019 +0200

    bidi: Disable Arabic ligatures
    
    https://gitlab.gnome.org/GNOME/vte/issues/142

 src/bidi.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/bidi.cc b/src/bidi.cc
index bf803437..da6b1e89 100644
--- a/src/bidi.cc
+++ b/src/bidi.cc
@@ -56,6 +56,9 @@
 static_assert (sizeof (FriBidiChar) == sizeof (gunichar), "Unexpected FriBidiChar size");
 #endif
 
+/* Don't do Arabic ligatures as per bug 142. */
+#define VTE_ARABIC_SHAPING_FLAGS (FRIBIDI_FLAGS_ARABIC & ~FRIBIDI_FLAG_SHAPE_ARAB_LIGA)
+
 using namespace vte::base;
 
 BidiRow::~BidiRow()
@@ -276,7 +279,7 @@ BidiRunner::explicit_line_shape(vte::grid::row_t row)
 
                 /* Shaping. */
                 fribidi_join_arabic (fribidi_chartypes, count, fribidi_levels, fribidi_joiningtypes);
-                fribidi_shape_arabic (FRIBIDI_FLAGS_ARABIC, fribidi_levels, count, fribidi_joiningtypes, 
fribidi_chars);
+                fribidi_shape_arabic (VTE_ARABIC_SHAPING_FLAGS, fribidi_levels, count, fribidi_joiningtypes, 
fribidi_chars);
 
                 /* If we have the shortcut notation for the trivial LTR mapping, we need to
                  * expand it to the nontrivial notation, in order to store the shaped character. */
@@ -585,7 +588,7 @@ BidiRunner::implicit_paragraph(vte::grid::row_t start, vte::grid::row_t end, boo
         if (do_shaping) {
                 /* Arabic shaping (on the entire paragraph in a single run). */
                 fribidi_join_arabic (fribidi_chartypes, count, fribidi_levels, fribidi_joiningtypes);
-                fribidi_shape_arabic (FRIBIDI_FLAGS_ARABIC, fribidi_levels, count, fribidi_joiningtypes, 
fribidi_chars);
+                fribidi_shape_arabic (VTE_ARABIC_SHAPING_FLAGS, fribidi_levels, count, fribidi_joiningtypes, 
fribidi_chars);
         }
 
         /* For convenience, from now on this variable contains the resolved (i.e. possibly autodetected) 
value. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]