Subject: Re: bug#5413: 23.1.91; Incorrect font sizes and weights

From: Jan Djärv <[email-masked]>
Date: Tue, 19 Jan 2010 16:02:30 +0100

Jed Brown skrev:
> I want Emacs to use the font that I get with
> 
>   $ urxvt -fn 'xft:DejaVu Sans Mono-10'
> 
> (or when this font name is given to any other program).  So the obvious
> thing to try would be
> 
>   $ emacs -Q -fn 'DejaVu Sans Mono-10'
> 
> but this resolves to
> 
>   xft:-unknown-DejaVu Sans Mono-normal-normal-normal-*-17-*-*-*-m-0-iso10646-1
> 
> which is way bigger than I want.  

What system are you rinning (i.e. Gnome, KDE, other?)?
Does
% xrdb -query|grep Xft
show anything?

How about
% xdpyinfo|grep resolution
?

Emacs now uses the DPI setting from the dekstop settings if available instead 
of the dpi reported by the X server.  You probably have a mismatch there.

> Next, I try manually specifying the
> font that 'DejaVu Sans Mono-10.2' resolved to in my last emacs build
> 
>   GNU Emacs 23.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.16.5) of 2009-10-08 on home.sergej.pp.ru
> 
> (I have no idea why this goofyness was required, but 'DejaVu Sans Mono-10' looked bad there.)
> 
>   $ emacs -Q -fn '-unknown-DejaVu Sans Mono-normal-normal-normal-*-14-*-*-*-m-0-iso10646-1'
> 

Get a new version from the trunk and get the value of the lisp variable 
xft-settings (C-h v xft-settings).

> And this font seems to be the correct size, but the weight is too light.

It is not the weight, it is the hinting.  Emacs uses the values from the 
desktop settings if available, or the fontconfig defaults otherwise.

	Jan D.