Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

default font used

15 views
Skip to first unread message

Buchs, Kevin

unread,
Jul 10, 2012, 10:24:28 AM7/10/12
to help-gn...@gnu.org

I’m building emacs 24 from source on OpenSuse Linux and the result comes up with a default font that is not desireable (-sony...). I’ve searched the code and have not yet found what determines the default font used. Can someone direct me to that, please.

- Kevin Buchs

 

Jason Rumney

unread,
Jul 10, 2012, 11:30:35 AM7/10/12
to
On Tuesday, 10 July 2012 22:24:28 UTC+8, Buchs, Kevin wrote:

> I’m building emacs 24 from source on OpenSuse Linux and the result comes up with a default font that is not desireable (-sony...). I’ve searched the code and have not yet found what determines the default font used. Can someone direct me to that, please.

The default font is chosen inside x_default_font_parameter in xfns.c. In the current development version as of a couple of days ago, the first match from the following list is used:

#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",

Drew Adams

unread,
Jul 10, 2012, 11:43:14 AM7/10/12
to Jason Rumney, help-gn...@gnu.org
> The default font is chosen inside x_default_font_parameter in
> xfns.c.... the first match from the following list is used:
> ...
> "-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",

Yes, but a user can set the font to use by default. See this:
http://emacswiki.org/emacs/SetFonts

E.g.: (set-face-attribute 'default nil :font FONT)

(Alternatively, you can set the `font' parameter in user option
`default-frame-alist'.)


Javier

unread,
Jul 13, 2012, 12:10:16 AM7/13/12
to

You can also set the font in the command line in Linux:

emacs -fn 10x20

if you define the font in .emacs it will override the command-line option
0 new messages