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: Tue, 30 Dec 2014 10:33:17 -0800 Message-ID: <87lhlonc7c.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> <87bnmqi1ps.fsf@secretsauce.net> <87mw65momt.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1419969437 6739 80.91.229.3 (30 Dec 2014 19:57:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Dec 2014 19:57:17 +0000 (UTC) Cc: 19117@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 30 20:57:10 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 1Y62uk-0005Cr-BY for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Dec 2014 20:57:10 +0100 Original-Received: from localhost ([::1]:38122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y62uj-0006Mp-Qn for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Dec 2014 14:57:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y62ug-0006Mi-8f for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2014 14:57:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y62ud-0003yP-05 for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2014 14:57:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y62uc-0003yK-P0 for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2014 14:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y62uc-0000aI-9K for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2014 14:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Dec 2014 19:57: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.14199694062208 (code B ref 19117); Tue, 30 Dec 2014 19:57:02 +0000 Original-Received: (at 19117) by debbugs.gnu.org; 30 Dec 2014 19:56:46 +0000 Original-Received: from localhost ([127.0.0.1]:33161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y62uL-0000ZW-NO for submit@debbugs.gnu.org; Tue, 30 Dec 2014 14:56:46 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:47698) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y62uJ-0000ZK-G1 for 19117@debbugs.gnu.org; Tue, 30 Dec 2014 14:56:44 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 5CEC520E9D for <19117@debbugs.gnu.org>; Tue, 30 Dec 2014 14:56:41 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Tue, 30 Dec 2014 14:56:41 -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; s=mesmtp; bh=7D1c+1GKUbXB zGVxMPf9/Z8gmTw=; b=CYhCD3NNj0Mcg1GOoVEEPssO6+aBLhlTm/VMvdpG/vwc P7jmBXXsczkWVj8+77VzEiaVne0bexrbCA0nPBqmyNA0IQDuoNJ70HdhnTgLw2oX aY5KxjPssgqFm8daOjaMhtA0yadSwaWy1msezDNExeqpgP4qgw1q+XCzTGO/6Ts= 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; s= smtpout; bh=7D1c+1GKUbXBzGVxMPf9/Z8gmTw=; b=NLS8RxZ0QDb93WgPBBKH fa1fUWILBjbA9eeLDIBIshmkww9P+TAcWG5usVjO7dv6DYDWrdZk4SOYIVbJs8Qq oGxLpRgVEW5ZFawMtRGdiyOnjwWsLsklphAddvAr1zzn2kKrbbLMfhPIei/HNSNV Nqef/ldN41C0Vv+xJZBwQVo= X-Sasl-enc: bp55rqSdRpI2Cr2KBSWhsprpHXqSCShltZJiKI6fgrdT 1419969401 Original-Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 0DBC16800C7; Tue, 30 Dec 2014 14:56:41 -0500 (EST) Original-Received: from dima by shorty.local with local (Exim 4.84) (envelope-from ) id 1Y62uG-0003QC-1e; Tue, 30 Dec 2014 11:56:40 -0800 In-reply-to: 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:97878 Archived-At: Stefan Monnier writes: >> 2. Do not set scalable-fonts-allowed to t in realize_basic_faces(). Does >> anybody know why this is desirable? > > Have you looked at the "git blame" output to try and see when/why we do that? I did look at earlier it without any particular enlightenment. But I just looked at it again, and it IS helpful, actually. This is all from 2001, written by Gerd Moellmann. Here are the changes in chronological order https://github.com/emacs-mirror/emacs/commit/702a1e8e https://github.com/emacs-mirror/emacs/commit/441bf856 https://github.com/emacs-mirror/emacs/commit/eeffb293 The logic was using a realizing_default_face_p variable (changed in the last commit), anad roughtly it did this: x_face_list_fonts() { get_all_fonts(); for(fonts) { if(!font_scalable) add to list; } if (realizing_default_face_p && no fonts in list && some were scalable) { for(fonts) { if(!font_scalable) add to list; } } ... } So we only added the scalable fonts if no other fonts were found. The new logic does not do this; it always adds the scalable fonts. The docstring of scalable-fonts-allowed further indicates that the original intent was a last-resort like before: Note that if value is nil, a scalable font might still be used, if no other font of the appropriate family and registry is available. I will patch xfont_list_pattern() to accept a 3rd type of scalable-fonts-allowed: 'fallback where we add these fonts only if no others are available, and in realize_basic_faces() I'll use THAT value. Does that sound reasonable?