emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing of fontconfig font names and other font related stuff.


From: Jan Djärv
Subject: Re: Parsing of fontconfig font names and other font related stuff.
Date: Wed, 08 Jul 2009 14:09:30 +0200
User-agent: Thunderbird 2.0.0.22 (X11/20090608)

Jan Djärv skrev:
Kenichi Handa skrev:
And, I don't know what dpi is for.  That information should
be available via X server.  Is it a way to pretend that you
are using a screen of the different DPI?

Yes. Gnome has 96 dpi as default (settable in a user desktop settings dialog), fontconfig seems to have 75. My monitor is actually 84 dpi. Other applications in Gnome, like gnome-terminal, uses the 96 dpi value, but Emacs uses the default. That makes Emacs and gnome-terminal look different even though they both use monospace-8.

Actually it is too late to add DPI in xftfont.c, because it must be added long before that. Font.c does DPI calculations all over the place, and assumes that either dpi=... is given in the font spec, or that the DPI for the monitor can be used. In fact, it is either 75 (fontconfig default) or 96 (GNOME default) that is used, so font.c is wrong (wrong == different from other applications) when a plain font name like monospace-8 is given.

It would be nice to be able to use XftDefaultSubstitute to pick up the GConf settings from the X database (GConf puts them there). But by the time the Xft driver has been choosen, the pixel size for the font has already been calculated, using another dpi-value.

How can we fix this?  Can we choose driver without calculating a pixel size?
The fast but kind of ugly way would be to add the defaults from XftDefaultSubstitute to the name if it is an fcname and Xft is present.

        Jan D.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]