[gnome-terminal] screen: Add support for increased line and character spacing
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] screen: Add support for increased line and character spacing
- Date: Mon, 4 Dec 2017 22:20:49 +0000 (UTC)
commit 76acb5d29a2cb2d8650aad62608e5064d1e683ef
Author: Egmont Koblinger <egmont gmail com>
Date: Mon Dec 4 23:15:59 2017 +0100
screen: Add support for increased line and character spacing
New hidden per-profile keys cell-{height,width}-scale take values
from 1.0 (default) to 2.0 (double spacing) to push the letters further
apart from each other, without affecting the font size.
https://bugzilla.gnome.org/show_bug.cgi?id=781479
https://bugzilla.gnome.org/show_bug.cgi?id=738781
src/org.gnome.Terminal.gschema.xml | 10 ++++++++++
src/terminal-schemas.h | 2 ++
src/terminal-screen.c | 9 ++++++++-
3 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index 7fd3105..2bfe3eb 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -137,6 +137,16 @@
<summary>Whether bold text should use the same color as normal text</summary>
<description>If true, boldface text will be rendered using the same color as normal text.</description>
</key>
+ <key name="cell-height-scale" type="d">
+ <range min="1.0" max="2.0" />
+ <default>1.0</default>
+ <summary>Scale factor for the cell height to increase line spacing. (Does not increase the font's
height.)</summary>
+ </key>
+ <key name="cell-width-scale" type="d">
+ <range min="1.0" max="2.0" />
+ <default>1.0</default>
+ <summary>Scale factor for the cell width to increase letter spacing. (Does not increase the font's
width.)</summary>
+ </key>
<key name="cursor-colors-set" type="b">
<default>false</default>
<summary>Whether to use custom cursor colors</summary>
diff --git a/src/terminal-schemas.h b/src/terminal-schemas.h
index 35ab577..25259d1 100644
--- a/src/terminal-schemas.h
+++ b/src/terminal-schemas.h
@@ -36,6 +36,8 @@ G_BEGIN_DECLS
#define TERMINAL_PROFILE_BACKSPACE_BINDING_KEY "backspace-binding"
#define TERMINAL_PROFILE_BOLD_COLOR_KEY "bold-color"
#define TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY "bold-color-same-as-fg"
+#define TERMINAL_PROFILE_CELL_HEIGHT_SCALE_KEY "cell-height-scale"
+#define TERMINAL_PROFILE_CELL_WIDTH_SCALE_KEY "cell-width-scale"
#define TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY "cursor-colors-set"
#define TERMINAL_PROFILE_CURSOR_BACKGROUND_COLOR_KEY "cursor-background-color"
#define TERMINAL_PROFILE_CURSOR_FOREGROUND_COLOR_KEY "cursor-foreground-color"
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 36d47ce..40ae539 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -815,7 +815,9 @@ terminal_screen_profile_changed_cb (GSettings *profile,
if (gtk_widget_get_realized (GTK_WIDGET (screen)) &&
(!prop_name ||
prop_name == I_(TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY) ||
- prop_name == I_(TERMINAL_PROFILE_FONT_KEY)))
+ prop_name == I_(TERMINAL_PROFILE_FONT_KEY) ||
+ prop_name == I_(TERMINAL_PROFILE_CELL_WIDTH_SCALE_KEY) ||
+ prop_name == I_(TERMINAL_PROFILE_CELL_HEIGHT_SCALE_KEY)))
terminal_screen_set_font (screen);
if (!prop_name ||
@@ -981,6 +983,11 @@ terminal_screen_set_font (TerminalScreen *screen)
vte_terminal_set_font (VTE_TERMINAL (screen), desc);
pango_font_description_free (desc);
+
+ vte_terminal_set_cell_width_scale (VTE_TERMINAL (screen),
+ g_settings_get_double (profile, TERMINAL_PROFILE_CELL_WIDTH_SCALE_KEY));
+ vte_terminal_set_cell_height_scale (VTE_TERMINAL (screen),
+ g_settings_get_double (profile,
TERMINAL_PROFILE_CELL_HEIGHT_SCALE_KEY));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]