diff src/xfns.c @ 106162:4cee82a6f25b

Always suggest system font because .emacs may not have been read yet. * xfns.c (x_default_font_parameter): Call xsettings_get_system_font. * xsettings.h: Declare xsettings_get_system_font. * xsettings.c (xsettings_get_system_font): New function. (init_gconf): No use initiating gconf unless we have Xft also. (syms_of_xsettings): Only provide system-font-setting if HAVE_XFT and HAVE_GCONF.
author Jan Djärv <jan.h.d@swipnet.se>
date Fri, 20 Nov 2009 09:44:42 +0000
parents 8c46fe65b4c6
children 01190029e5d3
line wrap: on
line diff
--- a/src/xfns.c	Fri Nov 20 08:54:18 2009 +0000
+++ b/src/xfns.c	Fri Nov 20 09:44:42 2009 +0000
@@ -3031,14 +3031,21 @@
   Lisp_Object font;
   int got_from_gconf = 0;
   if (EQ (font_param, Qunbound))
+    font_param = Qnil;
+
+  if (NILP (font_param))
     {
-      font_param = Ffont_get_system_font();
-      got_from_gconf = !NILP (font_param);
+      /* System font takes precedendce over X resources.  We must suggest this
+         regardless of font-use-system-font because .emacs may not have been
+         read yet.  */
+      const char *system_font = xsettings_get_system_font ();
+      if (system_font) font_param = make_string (system_font,
+                                                 strlen (system_font));
     }
-
+  
   font = !NILP (font_param) ? font_param
     : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING);
-  
+
   if (! STRINGP (font))
     {
       char *names[]