[gnome-terminal] profile: Add hidden BiDi and shaping preferences



commit 39272f5d6e9a6153a7a460297966c26487940535
Author: Egmont Koblinger <egmont gmail com>
Date:   Sun Jun 30 15:33:39 2019 +0200

    profile: Add hidden BiDi and shaping preferences
    
    https://gitlab.gnome.org/GNOME/vte/issues/53

 src/org.gnome.Terminal.gschema.xml | 10 ++++++++++
 src/terminal-schemas.h             |  2 ++
 src/terminal-screen.c              |  7 +++++++
 3 files changed, 19 insertions(+)
---
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index e4e0c003..b9e7d741 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -183,6 +183,16 @@
       <summary>Highlight foreground colour</summary>
       <description>Custom color for the foreground of the text character at the terminal’s highlight 
position, as a color specification (can be HTML-style hex digits, or a color name such as “red”). This is 
ignored if highlight-colors-set is false.</description>
     </key>
+    <key name="enable-bidi" type="b">
+      <default>true</default>
+      <summary>Whether to perform bidirectional text rendering</summary>
+      <description>If true, perform bidirectional text rendering (“BiDi”).</description>
+    </key>
+    <key name="enable-shaping" type="b">
+      <default>true</default>
+      <summary>Whether to perform Arabic shaping</summary>
+      <description>If true, shape Arabic text.</description>
+    </key>
     <key name="allow-bold" type="b">
       <default>true</default>
       <summary>Whether to allow bold text</summary>
diff --git a/src/terminal-schemas.h b/src/terminal-schemas.h
index ef30bd59..bd2fa8c5 100644
--- a/src/terminal-schemas.h
+++ b/src/terminal-schemas.h
@@ -49,6 +49,8 @@ G_BEGIN_DECLS
 #define TERMINAL_PROFILE_DEFAULT_SIZE_COLUMNS_KEY       "default-size-columns"
 #define TERMINAL_PROFILE_DEFAULT_SIZE_ROWS_KEY          "default-size-rows"
 #define TERMINAL_PROFILE_DELETE_BINDING_KEY             "delete-binding"
+#define TERMINAL_PROFILE_ENABLE_BIDI_KEY                "enable-bidi"
+#define TERMINAL_PROFILE_ENABLE_SHAPING_KEY             "enable-shaping"
 #define TERMINAL_PROFILE_ENCODING_KEY                   "encoding"
 #define TERMINAL_PROFILE_EXIT_ACTION_KEY                "exit-action"
 #define TERMINAL_PROFILE_FONT_KEY                       "font"
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 23134e80..684da49a 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -829,6 +829,13 @@ terminal_screen_profile_changed_cb (GSettings     *profile,
   vte_terminal_set_delete_binding (vte_terminal,
                                    g_settings_get_enum (profile, TERMINAL_PROFILE_DELETE_BINDING_KEY));
 
+  if (!prop_name || prop_name == I_(TERMINAL_PROFILE_ENABLE_BIDI_KEY))
+    vte_terminal_set_enable_bidi (vte_terminal,
+                                  g_settings_get_boolean (profile, TERMINAL_PROFILE_ENABLE_BIDI_KEY));
+  if (!prop_name || prop_name == I_(TERMINAL_PROFILE_ENABLE_SHAPING_KEY))
+    vte_terminal_set_enable_shaping (vte_terminal,
+                                     g_settings_get_boolean (profile, TERMINAL_PROFILE_ENABLE_SHAPING_KEY));
+
   if (!prop_name || prop_name == I_(TERMINAL_PROFILE_ALLOW_BOLD_KEY))
     vte_terminal_set_allow_bold (vte_terminal,
                                  g_settings_get_boolean (profile, TERMINAL_PROFILE_ALLOW_BOLD_KEY));


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