!4 173282 pluma文本编辑器设置中文名字体后无法生效

Merge pull request !4 from 邓好/openkylin/yangtze
This commit is contained in:
zhangtianxiong 2023-06-05 07:08:32 +00:00 committed by Gitee
commit 84a21f8ebc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 24 additions and 2 deletions

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
pluma (1.24.0-ok4) yangtze; urgency=medium
* BUG: 173282 pluma文本编辑器设置中文名字体后无法生效
* 需求号:无
* 其他改动change pluma-view.c 解决设置不生效问题
* 其他改动影响域:无
-- denghao <denghao@kylinos.cn> Fri, 02 Jun 2023 17:03:07 +0800
pluma (1.24.0-ok3) yangtze; urgency=medium
* update version info

View File

@ -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);
}