GNU bug report logs - #2334
23.0.90; emacs-snapshot has ugly fonts when using set-default-font elisp function

Previous Next

Package: emacs;

Reported by: "Theodore Ts'o" <tytso <at> mit.edu>

Date: Sun, 15 Feb 2009 05:40:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 2334 in the body.
You can then email your comments to 2334 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2334; Package emacs. (Sun, 15 Feb 2009 05:40:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Theodore Ts'o" <tytso <at> mit.edu>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 15 Feb 2009 05:40:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Theodore Ts'o" <tytso <at> mit.edu>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.90; emacs-snapshot has ugly fonts when using set-default-font elisp function
Date: Sun, 15 Feb 2009 00:32:28 -0500
Using emacs-snapshot-20090207, the text display becomes very ugly when
set via:

(set-default-font "DejaVu Sans Mono-10")

However, if the font is set via the menu bar: Options->Set Default Font

then the fonts look good (i.e., with proper anti-aliasing).



In GNU Emacs 23.0.90.1 (i486-pc-linux-gnu, GTK+ Version 2.14.4)
 of 2009-02-10 on iridium, modified by Debian
 (emacs-snapshot package, version 1:20090207-1~intrepid1)
Windowing system distributor `The X.Org Foundation', version 11.0.10502000
configured using `configure  '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.90/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.90/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  display-time-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x s e t - f SPC a SPC s SPC <tab> <tab> <return> 
C-g <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar> 
<options> <menu-set-font> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <menu-bar> <options> <menu-set-font> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <right> M-x r e p o SPC SPC r SPC SPC SPC 
<return> C-g C-x C-f C-g M-x r e p o r SPC SPC SPC 
<return>

Recent messages:
Skipping dictionaries-common setup for emacs-snapshot
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Loading /etc/emacs/site-start.d/50psvn.el (source)...done
Loading /home/tytso/.emacs.custom...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
Quit [2 times]
call-interactively: End of buffer
Making completion list... [2 times]
Quit
Quit




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2334; Package emacs. (Mon, 16 Feb 2009 15:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 16 Feb 2009 15:30:04 GMT) Full text and rfc822 format available.

Message #10 received at 2334 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Kenichi Handa  <handa <at> m17n.org>
Cc: "Theodore Ts'o" <tytso <at> mit.edu>, 2334 <at> debbugs.gnu.org
Subject: Re: 23.0.90; emacs-snapshot has ugly fonts when using set-default-font elisp function
Date: Mon, 16 Feb 2009 10:26:16 -0500
"Theodore Ts'o" <tytso <at> mit.edu> wrote:

> Using emacs-snapshot-20090207, the text display becomes very ugly when
> set via:
> (set-default-font "DejaVu Sans Mono-10")
> However, if the font is set via the menu bar: Options->Set Default Font
> then the fonts look good (i.e., with proper anti-aliasing).

Hi Handa-san,

I think we should give the xft font backend (where it is available) a
higher priority than the x backend; otherwise, users will keep
experiencing bugs like this.

WDYT?




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2334; Package emacs. (Mon, 16 Feb 2009 17:05:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Theodore Tso <tytso <at> mit.edu>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 16 Feb 2009 17:05:05 GMT) Full text and rfc822 format available.

Message #15 received at 2334 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Theodore Tso <tytso <at> mit.edu>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Kenichi Handa <handa <at> m17n.org>, 2334 <at> debbugs.gnu.org
Subject: Re: 23.0.90; emacs-snapshot has ugly fonts when using
	set-default-font elisp function
Date: Mon, 16 Feb 2009 11:00:05 -0500
On Mon, Feb 16, 2009 at 10:26:16AM -0500, Chong Yidong wrote:
> "Theodore Ts'o" <tytso <at> mit.edu> wrote:
> 
> > Using emacs-snapshot-20090207, the text display becomes very ugly when
> > set via:
> > (set-default-font "DejaVu Sans Mono-10")
> > However, if the font is set via the menu bar: Options->Set Default Font
> > then the fonts look good (i.e., with proper anti-aliasing).
> 
> Hi Handa-san,
> 
> I think we should give the xft font backend (where it is available) a
> higher priority than the x backend; otherwise, users will keep
> experiencing bugs like this.
> 
> WDYT?

Stupid question --- is there a way to force the right thing to happen
from emacs-lisp?  My biggest gripe is that I couldn't figure out a way
to make the right thing happem from my .emacs.el file, despite a lot
of time spent trying to find the right interfaces via M-x apropos.  So
at the moment, I'm firing up emacs, and then having to use
Options->Set Default Font from the menu bar to change to a small font
size.  (And I'm an old-school emacs person who normally would run with
the menu bar and tool bar disabled.  :-)

I suspect the correct default though should be to give the xft font
backend a higher priority; especially at the moment, where many people
are using emacs-snapshot *because* of the nicer font display.

Thanks, regards,

						- Ted









Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2334; Package emacs. (Mon, 16 Feb 2009 18:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 16 Feb 2009 18:30:03 GMT) Full text and rfc822 format available.

Message #20 received at 2334 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Theodore Tso <tytso <at> mit.edu>
Cc: Kenichi Handa <handa <at> m17n.org>, 2334 <at> debbugs.gnu.org
Subject: Re: 23.0.90; emacs-snapshot has ugly fonts when using set-default-font elisp function
Date: Mon, 16 Feb 2009 13:22:54 -0500
Theodore Tso <tytso <at> mit.edu> writes:

> Stupid question --- is there a way to force the right thing to happen
> from emacs-lisp?  My biggest gripe is that I couldn't figure out a way
> to make the right thing happem from my .emacs.el file

Something like this will do the trick:

  (set-frame-parameter nil 'font-backend '(xft x))




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2334; Package emacs. (Wed, 18 Feb 2009 06:05:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kenichi Handa <handa <at> m17n.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 18 Feb 2009 06:05:08 GMT) Full text and rfc822 format available.

Message #25 received at 2334 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Kenichi Handa <handa <at> m17n.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: tytso <at> mit.edu, 2334 <at> debbugs.gnu.org
Subject: Re: 23.0.90; emacs-snapshot has ugly fonts when using set-default-font elisp function
Date: Wed, 18 Feb 2009 15:00:39 +0900
In article <8763jaqu7b.fsf <at> cyd.mit.edu>, Chong Yidong <cyd <at> stupidchicken.com> writes:

> "Theodore Ts'o" <tytso <at> mit.edu> wrote:
> > Using emacs-snapshot-20090207, the text display becomes very ugly when
> > set via:
> > (set-default-font "DejaVu Sans Mono-10")
> > However, if the font is set via the menu bar: Options->Set Default Font
> > then the fonts look good (i.e., with proper anti-aliasing).

> Hi Handa-san,

> I think we should give the xft font backend (where it is available) a
> higher priority than the x backend; otherwise, users will keep
> experiencing bugs like this.

I at first want to figure out why the above two methods for
seting a font are different.  At least, I can't reproduce
the difference.  Can you?  When I have "dejavu sans mono"
fonts both for fontconfig and X as below, both methods set
the default font to X font.

% fc-list 'dejavu sans mono'
DejaVu Sans Mono:style=Bold Oblique
DejaVu Sans Mono:style=Oblique
DejaVu Sans Mono:style=Book
DejaVu Sans Mono:style=Bold
% xlsfonts '*-dejavu sans mono-*'
-dejavu-dejavu sans mono-bold-o-normal--0-0-0-0-c-0-iso10646-1
-dejavu-dejavu sans mono-bold-o-normal--0-0-0-0-m-0-iso10646-1
-dejavu-dejavu sans mono-bold-r-normal--0-0-0-0-c-0-iso10646-1
-dejavu-dejavu sans mono-bold-r-normal--0-0-0-0-m-0-iso10646-1
-dejavu-dejavu sans mono-medium-o-normal--0-0-0-0-c-0-iso10646-1
-dejavu-dejavu sans mono-medium-o-normal--0-0-0-0-m-0-iso10646-1
-dejavu-dejavu sans mono-medium-r-normal--0-0-0-0-c-0-iso10646-1
-dejavu-dejavu sans mono-medium-r-normal--0-0-0-0-m-0-iso10646-1
[...]

---
Kenichi Handa
handa <at> m17n.org




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2334; Package emacs. (Wed, 18 Feb 2009 13:50:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 18 Feb 2009 13:50:10 GMT) Full text and rfc822 format available.

Message #30 received at 2334 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Kenichi Handa <handa <at> m17n.org>
Cc: tytso <at> mit.edu, 2334 <at> debbugs.gnu.org
Subject: Re: 23.0.90; emacs-snapshot has ugly fonts when using set-default-font elisp function
Date: Wed, 18 Feb 2009 08:48:45 -0500
Kenichi Handa <handa <at> m17n.org> writes:

> I at first want to figure out why the above two methods for
> seting a font are different.  At least, I can't reproduce
> the difference.  Can you?  When I have "dejavu sans mono"
> fonts both for fontconfig and X as below, both methods set
> the default font to X font.

I do see this bug.

I have 'Emacs.Font: Monospace 9' in my .Xresources file.  With
`emacs -Q', C-u C-x = reports the font as

    xft:-unknown-DejaVu Sans
    Mono-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1 (#x1E)

If I then do

 M-: (modify-frame-parameters (selected-frame)
                              (list (cons 'font "DejaVu Sans Mono 9")))

the font becomes non-antialised, and C-u C-x = reports

    x:-dejavu-dejavu sans
    mono-medium-r-normal--12-87-100-100-m-70-iso8859-1 (#x3B)

My results for fc-list and xlsfonts are the same as yours.




Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Thu, 19 Feb 2009 03:25:04 GMT) Full text and rfc822 format available.

Notification sent to "Theodore Ts'o" <tytso <at> mit.edu>:
bug acknowledged by developer. (Thu, 19 Feb 2009 03:25:04 GMT) Full text and rfc822 format available.

Message #35 received at 2334-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Kenichi Handa <handa <at> m17n.org>
Cc: tytso <at> mit.edu, 2334-done <at> debbugs.gnu.org
Subject: Re: 23.0.90; emacs-snapshot has ugly fonts when using set-default-font elisp function
Date: Wed, 18 Feb 2009 22:18:11 -0500
Kenichi Handa <handa <at> m17n.org> writes:

> I at first want to figure out why the above two methods for
> seting a font are different.  At least, I can't reproduce
> the difference.  Can you?  When I have "dejavu sans mono"
> fonts both for fontconfig and X as below, both methods set
> the default font to X font.

If the frame is already using an XFT font, doing

 (set-face-attribute 'default (selected-frame)
                     :font "DejaVu Sans Mono 10")

will give an XFT (anti-aliased) version of DejaVu Sans Mono.  If the
frame is using an X font, the same code gives the X version of DejaVu
Sans Mono.

Doing

  (modify-frame-parameters (selected-frame)
     (list (cons 'font "DejaVu Sans Mono 10")))

always returns the X version.  This discrepancy is due to the use of
font_open_by_name instead of font_load_for_lface.

I don't think there is anything that need to be corrected, apart from
giving the XFT driver a higher priority; I've just done that.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Thu, 19 Mar 2009 14:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.