[vte/wip/egmont/bidi: 17/107] fribidi_get_mirror_char



commit 4e618a08d21cdf4456354fc25daa63812bc63685
Author: Egmont Koblinger <egmont gmail com>
Date:   Mon Aug 20 14:19:06 2018 +0200

    fribidi_get_mirror_char

 src/vtedraw.cc | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/vtedraw.cc b/src/vtedraw.cc
index f3254b8f..208f6f0c 100644
--- a/src/vtedraw.cc
+++ b/src/vtedraw.cc
@@ -26,6 +26,10 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 
+#ifdef WITH_FRIBIDI
+#include <fribidi.h>
+#endif
+
 #include "vtedraw.hh"
 #include "vtedefines.hh"
 #include "debug.h"
@@ -1491,7 +1495,15 @@ _vte_draw_text_internal (struct _vte_draw *draw,
 
                 if (G_UNLIKELY (requests[i].mirror)) {
                         // FIXME what if 'c' is actually a real vteunistr?
+#ifdef WITH_FRIBIDI
+                        /* Prefer the FriBidi variant as that's more likely
+                         * to be in sync with the rest of our BiDi stuff. */
+                        fribidi_get_mirror_char (c, &c);
+#else
+                        /* Fall back to glib, so that we still get mirrored
+                         * characters in explicit RTL mode. */
                         g_unichar_get_mirror_char (c, &c);
+#endif
                 }
 
                struct unistr_info *uinfo = font_info_get_unistr_info (font, c);


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