summaryrefslogtreecommitdiff
path: root/gedit
diff options
context:
space:
mode:
authorlxylxy123456 <13691419520@163.com>2021-05-07 23:16:00 -0700
committerlxylxy123456 <ercli@ucdavis.edu>2021-05-09 17:00:22 +0000
commit69a076892102d6ddad0db171e13e6feddc65f2cd (patch)
tree9d596a03785414ddcd9b4aca9da163b48452adf7 /gedit
parentf1ad976bbfb5ea0e5b2a21731f04455da807ffdb (diff)
downloadgedit-69a076892102d6ddad0db171e13e6feddc65f2cd.tar.gz
gedit-pango.c: Quote font-family CSS string
Currently the css string generated by gedit_pango_font_description_to_css() does not quote the font-family string. If the font family name contains space, gtk may fail to parse the css string correctly (e.g. "Courier 10 Pitch"). To fix this issue, simly add double quotes to the font name. This fix should work for font names that do not contain special character (e.g. quotation marks, backslashes, etc.) https://gitlab.gnome.org/GNOME/gedit/-/issues/435
Diffstat (limited to 'gedit')
-rw-r--r--gedit/gedit-pango.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gedit/gedit-pango.c b/gedit/gedit-pango.c
index 0488bbcd2..85b44fe99 100644
--- a/gedit/gedit-pango.c
+++ b/gedit/gedit-pango.c
@@ -102,9 +102,9 @@ gedit_pango_font_description_to_css (const PangoFontDescription *desc)
set = pango_font_description_get_set_fields (desc);
if (set & PANGO_FONT_MASK_FAMILY)
{
- g_string_append (s, "font-family: ");
+ g_string_append (s, "font-family: \"");
g_string_append (s, pango_font_description_get_family (desc));
- g_string_append (s, "; ");
+ g_string_append (s, "\"; ");
}
if (set & PANGO_FONT_MASK_STYLE)
{