From 47d6b13863c9285c37b2ac7630d51b4e1abef914 Mon Sep 17 00:00:00 2001 From: denghao Date: Fri, 2 Jun 2023 17:04:25 +0800 Subject: [PATCH] =?UTF-8?q?173282=20pluma=E6=96=87=E6=9C=AC=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E8=AE=BE=E7=BD=AE=E4=B8=AD=E6=96=87=E5=90=8D?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=90=8E=E6=97=A0=E6=B3=95=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 9 +++++++++ pluma/pluma-view.c | 17 +++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5ca3231..8fbf8c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +pluma (1.24.0-ok4) yangtze; urgency=medium + + * BUG: 173282 pluma文本编辑器设置中文名字体后无法生效 + * 需求号:无 + * 其他改动:change pluma-view.c 解决设置不生效问题 + * 其他改动影响域:无 + + -- denghao Fri, 02 Jun 2023 17:03:07 +0800 + pluma (1.24.0-ok3) yangtze; urgency=medium * update version info diff --git a/pluma/pluma-view.c b/pluma/pluma-view.c index 6dce627..3af1969 100644 --- a/pluma/pluma-view.c +++ b/pluma/pluma-view.c @@ -789,6 +789,19 @@ system_font_changed_cb (GSettings *settings, } } +static gchar* +get_font_family(PangoFontDescription *font) +{ + const char* font_familay = pango_font_description_get_family (font); + if (font_familay == NULL) + return g_strdup(""); + + if (font_familay[0] != '"') + return g_strdup_printf ("font-family: \"%s\"; ", font_familay); + + return g_strdup_printf ("font-family: %s; ", font_familay); +} + void pluma_override_font (const gchar *item, GtkWidget *widget, @@ -802,7 +815,7 @@ pluma_override_font (const gchar *item, const gchar *style; gchar *size; - family = g_strdup_printf ("font-family: %s;", pango_font_description_get_family (font)); + family = get_font_family(font); weight = g_strdup_printf ("font-weight: %d;", pango_font_description_get_weight (font)); @@ -899,7 +912,7 @@ pluma_view_set_font (PlumaView *view, sys_font_desc = get_system_font (); if (sys_font_desc) { - pluma_override_font ("label", GTK_WIDGET (view), sys_font_desc); + //pluma_override_font ("label", GTK_WIDGET (view), sys_font_desc); pango_font_description_free (sys_font_desc); }