Subject: Re: 23.0.90; emacs-snapshot has ugly fonts when using set-default-font elisp function

From: Chong Yidong <[email-masked]>
Date: Wed, 18 Feb 2009 22:18:11 -0500

Kenichi Handa <[email-masked]> 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.