Subject: Re: bug#6526: 24.0.50; Font X resouce is ignored

From: Kenichi Handa <[email-masked]>
Date: Wed, 30 Jun 2010 16:41:35 +0900

In article <[email-masked]>, Jan Djärv <[email-masked]> writes:

> Application font is not what we use, it is Monospaced font.  Other things to 
> check for:

Ah! Perhaps you actually mean "Fixed width font".  When I
change it from "monospace" to "freemono", Emacs surely uses
"freemono" font.

> Did you compile --with-gconf (the default if GConf libraries are found)

Yes. src/config.h contains this line:

/* Define to 1 if using GConf. */
#define HAVE_GCONF 1

> and customize font-use-system-font to t?

No.  The docstring says "*Non-nil means to use the system
defined font.", but doesn't say what "nil" means.  Anyway,
if there's no Font X resource, it seems that Emacs uses the
system defined font even if font-use-system-font is nil.

Previously, if there's no Font X resource, Emacs tried to
use one of these predefined fonts (extracted from
x_default_font_parameter):

      char *names[]
	= {
#ifdef HAVE_XFT
	    /* This will find the normal Xft font.  */
 	    "monospace-10",
#endif
	    "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1",
	    "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
	    "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
	    /* This was formerly the first thing tried, but it finds
	       too many fonts and takes too long.  */
	    "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1",
	    /* If those didn't work, look for something which will
	       at least work.  */
	    "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1",
	    "fixed",
	    NULL };

So, the current behaviour is still different from the
previous one.  Though I'm not claiming that the current
behaviour is worse.

> You can check for feature system-font-setting in Emacs, it is set if GConf is 
> compiled in.

(featurep 'system-font-setting) => t

> The function font-get-system-font should return the system 
> monospaced font.  You can get application font by calling 
> font-get-system-normal-font.

Both return nil.

When I customize font-use-system-font to t, they return
correct font names.  It's a little bit strange behavior.  I
think they should return font names even if
font-use-system-font is non-nil.

---
Kenichi Handa
[email-masked]