From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#59347: 29.0.50; `:family` face setting ignored Date: Tue, 22 Nov 2022 15:17:30 +0000 Message-ID: <0d1ea3007f614b19d262@heytings.org> References: <83bkp4bfqf.fsf@gnu.org> <83wn7s9txp.fsf@gnu.org> <83pmdk9pat.fsf@gnu.org> <83cz9j9zyu.fsf@gnu.org> <838rk77yfo.fsf@gnu.org> <834juu9aya.fsf@gnu.org> <7cc9e03786024fc72f3b@heytings.org> <83a64l65ai.fsf@gnu.org> <7cc9e0378678a092e6ee@heytings.org> <835yf962q4.fsf@gnu.org> <7cc9e03786754c9e0aaf@heytings.org> <83zgcl4jra.fsf@gnu.org> <7cc9e03786c281cffdd4@heytings.org> <83tu2t4ie9.fsf@gnu.org> <7cc9e03786e324ff82ef@heytings.org> <83bkp04gjl.fsf@gnu.org> <83leo42vm9.fsf@gnu.org> <83edtv12ru.fsf@gnu.org> <0d1ea3007f4b5ca9c1c3@heytings.org> <83bkoz11pa.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26589"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 59347@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 22 16:19:42 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxV3m-0006iv-Gx for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Nov 2022 16:19:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxV3a-0006mv-Lp; Tue, 22 Nov 2022 10:19:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxV2B-00063R-TW for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2022 10:18:47 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oxV2A-0003kr-FM for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2022 10:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxV2A-0003wC-BK for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2022 10:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2022 15:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59347 X-GNU-PR-Package: emacs Original-Received: via spool by 59347-submit@debbugs.gnu.org id=B59347.166913025415064 (code B ref 59347); Tue, 22 Nov 2022 15:18:02 +0000 Original-Received: (at 59347) by debbugs.gnu.org; 22 Nov 2022 15:17:34 +0000 Original-Received: from localhost ([127.0.0.1]:52249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxV1i-0003uu-5y for submit@debbugs.gnu.org; Tue, 22 Nov 2022 10:17:34 -0500 Original-Received: from heytings.org ([95.142.160.155]:54580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxV1g-0003uk-7e for 59347@debbugs.gnu.org; Tue, 22 Nov 2022 10:17:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1669130251; bh=Wc0ZehrD3x0FpCLox4AuP+ixWZhLrRURyCoqUvO5jnI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=mty9fOyXrDZRXsbIdDPbUViZqbeCylIfGAVaLRL7Qofr1w2FMA09qSUhOusGYPere wLlYyLjNQawYHopq+rJHSPgQ4hETMBjf7hmaD/SgX4b4IsqsWdERCQMmOl6GGWlMVi ipwGz6k07jg0WWwcntoJtrDGxt/3IoHX7X2cpgkEPbZSquDvmIVzoHBfnOcBrGP2o+ cIrPg5tD0Ok4NtCqSxB16FUDkj2IPpwz95nXDdUMZHV5o6s+CUDkLo6zZJJAIeXDzJ J9QQbw2suf/YgbvLqLtzvaTdYRVkxidQVLR2pv8AnnEZ/U+cWhC5qWcuKa12iumagt H8HQuIeLG7McQ== In-Reply-To: <83bkoz11pa.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248650 Archived-At: >> The variable-pitch face should use a variable pitch font, shouldn't it? >> Unless there are no such fonts installed on the computer of course, in >> which case it could fall back to a monospace font. > > You know it and I know it, but how should the code which examines the > fonts know it? AFAICT, nothing tells it to reject fixed-pitch fonts. > Or did I miss something? > Nothing tells it to reject fixed-pitch fonts as a last resort indeed. But clearly the code should not select a fixed-pitch font _because_ it is the only available font that supports say a 'semi-bold' weight, when variable pitch fonts that support a 'bold' weight are in fact available. >> Why should the weight of the default face influence the font selected >> for the variable-pitch face > > Because if the default face is bold, so should be other faces, > preferably. To keep a consistent appearance, so to say. And the same > goes for slant and width. > With the code on master, the effect is the opposite of consistence. With the patch the effect is consistent: when the default face is say 'semi-bold', a 'bold' variable pitch font can be considered the best match for the variable-pitch face. >> to the point that even when variable pitch fonts are installed on the >> computer, they are all flatly rejected because they do not explicitly >> support say the 'semi-bold' weight? The weight of the default face >> should only influence the weight of the other faces > > How are "other faces", where you agree that the weight should matter, > different from the variable-pitch face, where you don't agree? > What I said above was perhaps not clear enough. There is nothing special about the variable-pitch face, I only used it to make the problem of the code on master as clear as possible. Of course the weight of the default face should influence the weight of all other faces. But not to the point that a 'bold' variable pitch font is never even considered as a potential candidate for the variable-pitch face. > > Anyway, I'm okay with doing what you suggest as a fallback, if the code > we have now somehow didn't produce satisfactory results. > It's not that it doesn't produce satisfactory results, it's that it doesn't do what it is meant to do. The scoring mechanism for the weight/slant/width attributes is simply bypassed. Without unsetting these three attributes, font_list_entities only produces candidates that are exact matches (e.g. only "bold" fonts are returned), and the whole point of scoring ("when searching for a semi-bold font, bold is better than medium and worse than extra-bold") is entirely lost. My patch simply restores the scoring mechanism (and fixes at least three bugs: 37473, 57555 and 59347). >> With a 'semi-bold' default face, a 'bold' variable pitch font is a >> legitimate candidate for the variable-pitch face. > > But your patch doesn't "loosen" just one attribute, it does that with > all 3 in one blow. Maybe if we "loosen" just one, we will be able to > find a match for the other two. I don't think font_score guarantees > that, does it? > It does that because these three attributes are those that are considered by the font scoring mechanism (together with the size, which is set to nil two lines above). The scoring mechanism guarantees that the best match, depending on the user preferences specified in face-font-selection-order, will be selected.