From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes Date: Fri, 26 Dec 2014 11:43:36 -0800 Message-ID: <87bnmqi1ps.fsf@secretsauce.net> References: <878uj674zh.fsf@secretsauce.net> <831tox7t03.fsf@gnu.org> <87a92zrj4b.fsf@secretsauce.net> <83egsbzbfu.fsf@gnu.org> <87r3vykdse.fsf@secretsauce.net> <87ppbikb6g.fsf@secretsauce.net> <54944426.6090900@yandex.ru> <878ui3jkx0.fsf@secretsauce.net> <5497D623.7040406@swipnet.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1419626520 15325 80.91.229.3 (26 Dec 2014 20:42:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Dec 2014 20:42:00 +0000 (UTC) Cc: 19117@debbugs.gnu.org To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 26 21:41:54 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y4bhq-0003yd-0Q for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Dec 2014 21:41:54 +0100 Original-Received: from localhost ([::1]:54354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y4bhp-0003bc-Bd for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Dec 2014 15:41:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y4bh4-0002VW-Kd for bug-gnu-emacs@gnu.org; Fri, 26 Dec 2014 15:41:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y4bh1-0000k6-Cd for bug-gnu-emacs@gnu.org; Fri, 26 Dec 2014 15:41:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y4bh1-0000k2-6V for bug-gnu-emacs@gnu.org; Fri, 26 Dec 2014 15:41:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y4bh0-0005Lo-B2 for bug-gnu-emacs@gnu.org; Fri, 26 Dec 2014 15:41:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Dec 2014 20:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19117-submit@debbugs.gnu.org id=B19117.141962645220543 (code B ref 19117); Fri, 26 Dec 2014 20:41:02 +0000 Original-Received: (at 19117) by debbugs.gnu.org; 26 Dec 2014 20:40:52 +0000 Original-Received: from localhost ([127.0.0.1]:58435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4bgp-0005LG-DW for submit@debbugs.gnu.org; Fri, 26 Dec 2014 15:40:51 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:54976) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4bgm-0005L6-PY for 19117@debbugs.gnu.org; Fri, 26 Dec 2014 15:40:49 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9EBAA208DE for <19117@debbugs.gnu.org>; Fri, 26 Dec 2014 15:40:48 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Fri, 26 Dec 2014 15:40:48 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:references:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=783IP65adTPSLQFG4JjiThMxbcU=; b=gcHiqhtH+vncwwAgxd i/qC162HBIXUTifasxCUvkmDLuxOQzdPokBYbqG6ox+fMR/66CIsoPY1ajFiXDYH ut1kArkfj/TvUapVi0VfOAw8vZies5Il3G0E2DX6MP9gwzLsbDYjXPiZnPwHR5fm 3z7xZhrM+aCFpkBTTaPMu6KS0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:cc:subject :date:in-reply-to:message-id:mime-version:content-type :content-transfer-encoding; s=smtpout; bh=783IP65adTPSLQFG4JjiTh MxbcU=; b=T0+iSQtW8OgB+CZCqTPUU4HmT/0uKmmzKVImCQfudgFTdWNgq2TCJO IiolD1D/8vRtlcmApTpgdajzQi4EhR3grbvJicrbK9pGdpfFg+WSmmqBNuXV3X0c uWhFgQiMiYa9qKaidxSOz1mNxzbSO9/h/26FZDkSoa53LGD4IaI7k= X-Sasl-enc: 4365e1Y9MuXmaNtq+tF0LKcObdVsz3ffR3t4uZCKzyC5 1419626448 Original-Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 4DD7AC00282; Fri, 26 Dec 2014 15:40:48 -0500 (EST) Original-Received: from dima by shorty.local with local (Exim 4.84) (envelope-from ) id 1Y4bgl-0003Wv-Qt; Fri, 26 Dec 2014 12:40:47 -0800 In-reply-to: <5497D623.7040406@swipnet.se> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97742 Archived-At: Jan Djärv writes: > Den 2014-12-19 23:46, Dima Kogan skrev: > >> The questions for Emacs are: >> >> - Should the candidate font list stay consistent as Emacs runs? >> - Should the candidate font list contain any scalable fonts? >> >> The answer to the 1st question is probably "yes". Do you know the answer >> to the 2nd? I can keep probing if you tell me which observed behavior is >> wrong. > > The answer to the first one is no. Or rather, it is out of Emacs control. > Since you are using non-client fonts, the list is determined by the X- or > font-server. The fact that you can get two matches suggests that your font > spec is underspecified, if your goal is to get just one specific font. > > I see no bug here. Hi. The observed behavior (same face getting different fonts of varying ugliness over time) cannot be considered correct, but I cannot yet say where the bad behavior lies. It could be in Emacs or X or the Debian font configuration. Looking at this some more, I'm now more confused than when I started. Any enlightenment is welcome. To summarize the earlier findings: - Emacs is asked for a font that matches the spec # - The font chosen by emacs can vary here. When it chooses the "ugly" path, it picks # - When X is asked for a corresponding font -adobe-courier-medium-i-normal-*-0-0-0-0-p-0-iso8859-1 it actually loads -urw-nimbus mono l-regular-o-normal--17-120-100-100-p-100-iso8859-1 Note that we originally sought an 11-px font, but got a 17-px one instead. OK. So the hypothesis is that the 11-px version of that 17-px urw font does not exist, hence it's down-scaling the 17-px version. However, apparently I can do xfontsel -pattern "-urw-nimbus mono l-regular-o-normal--11-*-*-*-p-70-iso8859-1" and it works. I.e. xfontsel doesn't complain that the font doesn't exist, it simply shows me the ugly 11-px font I'm complaining about. I don't think this font actually exists (it's ugly; a human would not draw it). However if I ask the font system whether it exists or not, it unambiguously says yes: $ xlsfonts -fn "-urw-nimbus mono l-regular-o-normal--11-*-*-*-p-70-iso8859-1" -urw-nimbus mono l-regular-o-normal--11-79-100-100-p-70-iso8859-1 However, when I use a wildcard for the font size, (so * instead of 11), it reports that the 11-px font does NOT exist, but a 17-px one does: $ xlsfonts -fn "-urw-nimbus mono l-regular-o-normal--*-*-*-*-p-70-iso8859-1" -urw-nimbus mono l-regular-o-normal--17-120-100-100-p-70-iso8859-1 This 17-px font looks good in xfontsel, but it's obviously bigger than the 11-px one. It looks like the font specs have a pixel-size and a point-size, (11-79) and (17-120), with the ratio staying roughly constant in either case, so the 11-79 is almost certainly a scaled version of 17-120. Problem is that the rendering is based on the px-size only, so it looks like crap. Is this how X fonts are supposed to work? What if Emacs treated scalable fonts by looking at the actual px-sizes that were available (17 in this case) and only evaluating those? Would that be a reasonable thing to do? I can work on an implementation if it is. Thanks