aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gtkutil.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 25ef5dd248d..cf5c31aa203 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -2282,7 +2282,16 @@ xg_get_font (struct frame *f, const char *default_name)
2282 default_name = x_last_font_name; 2282 default_name = x_last_font_name;
2283 2283
2284 if (default_name) 2284 if (default_name)
2285 gtk_font_chooser_set_font (GTK_FONT_CHOOSER (w), default_name); 2285 {
2286#ifdef HAVE_GTK3
2287 PangoFontDescription *desc
2288 = pango_font_description_from_string (default_name);
2289 gtk_font_chooser_set_font_desc (GTK_FONT_CHOOSER (w), desc);
2290 pango_font_description_free (desc);
2291#else
2292 gtk_font_chooser_set_font (GTK_FONT_CHOOSER (w), default_name);
2293#endif
2294 }
2286 2295
2287 gtk_widget_set_name (w, "emacs-fontdialog"); 2296 gtk_widget_set_name (w, "emacs-fontdialog");
2288 done = xg_dialog_run (f, w); 2297 done = xg_dialog_run (f, w);
@@ -2306,8 +2315,10 @@ xg_get_font (struct frame *f, const char *default_name)
2306 QCweight, XG_WEIGHT_TO_SYMBOL (weight), 2315 QCweight, XG_WEIGHT_TO_SYMBOL (weight),
2307 QCslant, XG_STYLE_TO_SYMBOL (style)); 2316 QCslant, XG_STYLE_TO_SYMBOL (style));
2308 2317
2318 char *font_desc_str = pango_font_description_to_string (desc);
2319 dupstring (&x_last_font_name, font_desc_str);
2320 g_free (font_desc_str);
2309 pango_font_description_free (desc); 2321 pango_font_description_free (desc);
2310 dupstring (&x_last_font_name, family);
2311 } 2322 }
2312 2323
2313#else /* Use old font selector, which just returns the font name. */ 2324#else /* Use old font selector, which just returns the font name. */