mirror of https://gitee.com/openkylin/pluma.git
173282 pluma文本编辑器设置中文名字体后无法生效
This commit is contained in:
parent
3e1bff32ca
commit
47d6b13863
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue