summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2020-11-13 17:53:57 +0100
committerChristian Persch <chpe@src.gnome.org>2020-11-13 17:53:57 +0100
commit11cb693c816b241e8660885dc48f2f5a1c6047ff (patch)
tree7c95cc1cd4adf265bdf06de05b14d08550b8d231
parent79e40dd5387a6a54ce418a082a4ebb6eaf60b20e (diff)
downloadvte-11cb693c816b241e8660885dc48f2f5a1c6047ff.tar.gz
lib: Sanitise the passed-in font description
Remove weight and style if set, so that SGR attributes can work.
-rw-r--r--src/vte.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vte.cc b/src/vte.cc
index bb311a08..deb64fc7 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -7246,6 +7246,14 @@ Terminal::set_font_desc(PangoFontDescription const* font_desc)
"Using default monospace font.\n");
}
+ /* Sanitise the font description. Style and weight need to be default here,
+ * since those are set via SGR attributes; and gravity makes no sense in vte.
+ */
+ pango_font_description_unset_fields(desc.get(),
+ PangoFontMask(PANGO_FONT_MASK_GRAVITY |
+ PANGO_FONT_MASK_STYLE |
+ PANGO_FONT_MASK_WEIGHT));
+
bool const same_desc = m_unscaled_font_desc &&
pango_font_description_equal(m_unscaled_font_desc.get(), desc.get());