[vte] widget: Improve font sanitisation
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] widget: Improve font sanitisation
- Date: Sun, 24 Jan 2021 19:44:32 +0000 (UTC)
commit ec2b76ab7c25ea9257048e6fd2d130e77b7a56cc
Author: Christian Persch <chpe src gnome org>
Date: Sun Jan 24 20:43:51 2021 +0100
widget: Improve font sanitisation
Clamp the font weight instead of simply unsetting any weight specified.
https://gitlab.gnome.org/GNOME/vte/-/issues/323
src/vte.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 04039257..7fc177d9 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -7354,8 +7354,9 @@ Terminal::update_font_desc()
if ((pango_font_description_get_set_fields(desc.get()) & PANGO_FONT_MASK_WEIGHT) &&
(pango_font_description_get_weight(desc.get()) > PANGO_WEIGHT_MEDIUM) &&
!m_bold_is_bright) {
- pango_font_description_unset_fields(desc.get(),
- PangoFontMask(PANGO_FONT_MASK_WEIGHT));
+ pango_font_description_set_weight(desc.get(),
+ std::min(pango_font_description_get_weight(desc.get()),
+ PANGO_WEIGHT_MEDIUM));
}
bool const same_desc = m_unscaled_font_desc &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]