diff options
author | Christian Persch <chpe@src.gnome.org> | 2020-11-13 17:53:57 +0100 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2020-11-13 17:53:57 +0100 |
commit | 11cb693c816b241e8660885dc48f2f5a1c6047ff (patch) | |
tree | 7c95cc1cd4adf265bdf06de05b14d08550b8d231 | |
parent | 79e40dd5387a6a54ce418a082a4ebb6eaf60b20e (diff) | |
download | vte-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.cc | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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()); |