[vte/wip/egmont/bidi: 35/82] fribidi_get_mirror_char



commit 36fc751969f8175b9cadeb0d2b04e866a6358acc
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 6f8c70d3..2da22038 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"
@@ -1478,7 +1482,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]