From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Parsing of fontconfig font names and other font related stuff. Date: Wed, 08 Jul 2009 14:09:30 +0200 Message-ID: <4A548C7A.5020309@swipnet.se> References: <4A539AB0.3010605@swipnet.se> <4A545A85.2060803@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: Quoted-Printable X-Trace: ger.gmane.org 1247055006 20684 80.91.229.12 (8 Jul 2009 12:10:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jul 2009 12:10:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 08 14:09:59 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MOVyI-0004H5-9e for ged-emacs-devel@m.gmane.org; Wed, 08 Jul 2009 14:09:58 +0200 Original-Received: from localhost ([127.0.0.1]:44354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOVyH-0001A1-IY for ged-emacs-devel@m.gmane.org; Wed, 08 Jul 2009 08:09:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOVyB-00018X-RU for emacs-devel@gnu.org; Wed, 08 Jul 2009 08:09:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOVy6-00012Z-UH for emacs-devel@gnu.org; Wed, 08 Jul 2009 08:09:51 -0400 Original-Received: from [199.232.76.173] (port=34679 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOVy6-00012W-Rt for emacs-devel@gnu.org; Wed, 08 Jul 2009 08:09:46 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:3940) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MOVy6-00008x-E8 for emacs-devel@gnu.org; Wed, 08 Jul 2009 08:09:46 -0400 Original-Received: from proxy1.bredband.net ([195.54.101.71]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOVy2-00079V-Ln for emacs-devel@gnu.org; Wed, 08 Jul 2009 08:09:42 -0400 Original-Received: from iph2.telenor.se (195.54.127.133) by proxy1.bredband.net (7.3.140.3) id 49F5A152017AF4A7 for emacs-devel@gnu.org; Wed, 8 Jul 2009 14:09:38 +0200 X-SMTPAUTH-B2: X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkewAAkpVEpV4S1uPGdsb2JhbACBUYgcjxcBAQEBN7c2hAgF X-IronPort-AV: E=Sophos;i="4.42,368,1243807200"; d="scan'208";a="26353494" Original-Received: from c-6e2de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.110]) by iph2.telenor.se with ESMTP; 08 Jul 2009 14:09:31 +0200 Original-Received: from [172.20.199.2] (gaffa [172.20.199.2]) by coolsville.localdomain (Postfix) with ESMTP id AB6BF7FA07B; Wed, 8 Jul 2009 14:09:30 +0200 (CEST) User-Agent: Thunderbird 2.0.0.22 (X11/20090608) In-Reply-To: <4A545A85.2060803@swipnet.se> X-Detected-Operating-System: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:112175 Archived-At: Jan Dj=E4rv 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? >=20 > Yes. Gnome has 96 dpi as default (settable in a user desktop settings=20 > dialog), fontconfig seems to have 75. My monitor is actually 84 dpi. =20 > Other applications in Gnome, like gnome-terminal, uses the 96 dpi value= ,=20 > but Emacs uses the default. That makes Emacs and gnome-terminal look=20 > 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=20 before that. Font.c does DPI calculations all over the place, and assume= s=20 that either dpi=3D... is given in the font spec, or that the DPI for the = monitor=20 can be used. In fact, it is either 75 (fontconfig default) or 96 (GNOME=20 default) that is used, so font.c is wrong (wrong =3D=3D different from ot= her=20 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 GC= onf=20 settings from the X database (GConf puts them there). But by the time th= e Xft=20 driver has been choosen, the pixel size for the font has already been=20 calculated, using another dpi-value. How can we fix this? Can we choose driver without calculating a pixel si= ze? The fast but kind of ugly way would be to add the defaults from=20 XftDefaultSubstitute to the name if it is an fcname and Xft is present. Jan D.