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: Mon, 21 Nov 2022 23:34:18 +0000 Message-ID: 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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EBMEAP53xz" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5806"; 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 00:35:22 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 1oxGJt-0001Hm-JM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Nov 2022 00:35:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxGJe-0002jG-6o; Mon, 21 Nov 2022 18:35:06 -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 1oxGJb-0002hP-6f for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 18:35:03 -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 1oxGJa-0005EI-UV for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 18:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxGJa-0004C4-CD for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 18:35: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: Mon, 21 Nov 2022 23:35: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.166907366616075 (code B ref 59347); Mon, 21 Nov 2022 23:35:02 +0000 Original-Received: (at 59347) by debbugs.gnu.org; 21 Nov 2022 23:34:26 +0000 Original-Received: from localhost ([127.0.0.1]:49121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxGJ0-0004BC-1q for submit@debbugs.gnu.org; Mon, 21 Nov 2022 18:34:26 -0500 Original-Received: from heytings.org ([95.142.160.155]:53592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxGIu-0004B0-FT for 59347@debbugs.gnu.org; Mon, 21 Nov 2022 18:34:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1669073658; bh=LGXL1wm7doMttobpFyqHRePLnxwK5NaBWOS4El2/YEE=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=znTdqrDq1B2uPoJ9ESmD+msUdmt4miy/D4KVF+tOvZQHrWB+FSvhKd+tPktWE7LPB nlJJ45vKsOtQ2yNE7m35UtcmcxlZz/qrgF1jMcUg2XqcQwimak7qo7Cfe1Jc124ToE +3TLsaxB9qrhTcbTscYTdNpL96gR1kl2xAjf9B3bN4huMqxXjtsJ4p14JnGncqI2Cw uqJAzfYKEbWYmDrUIC645gKEjTH92zbtHdewKpRmMvzh2zGIKWlu4PGzKk6GsU5BJr fkvL921UTzopRu4nGsrfFfeom1latJDXUG1dsFu8g+Mzqh201lFmTsJAd0cuaY3t8X eLtAWEHaykOjw== In-Reply-To: <83leo42vm9.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:248580 Archived-At: --EBMEAP53xz Content-Type: text/plain; format=flowed; charset=us-ascii I did some further testing to answer your previous email, and I now think that my previous patch is a half-measure, and that TRT would be to simply ignore the font weight specified in the default face while searching for other fonts. Consider the following recipe: emacs -Q M-: (fancy-startup-screen) RET and now evaluate the following lines in turn: (set-face-attribute 'default nil :font "Source Code Pro" :weight 'ultra-heavy) ;; 1 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'heavy) ;; 2 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'ultra-bold) ;; 3 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'bold) ;; 4 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'semi-bold) ;; 5 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'medium) ;; 6 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'normal) ;; 7 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'semi-light) ;; 8 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'light) ;; 9 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'ultra-light) ;; 10 (set-face-attribute 'default nil :font "Source Code Pro" :weight 'thin) ;; 11 (If you don't have the Source Code Pro font on your system, I'm sure you can find another font with more weight variants with which you will observe a similar effect.) With current master, the variable-pitch face is realized as follows: - with 1-3: -ADBO-Source Code Pro-black-normal-normal-*-29-*-*-*-m-0-iso10646-1, which is a monospace font - with 4: -PfEd-DejaVu Sans-bold-normal-normal-*-29-*-*-*-*-0-iso10646-1, which is a variable pitch font - with 5: -ADBO-Source Code Pro-semibold-normal-normal-*-29-*-*-*-m-0-iso10646-1, which is again a monospace font - with 6: -urw-nimbus sans l-regular-r-normal--29-210-100-100-p-158-iso8859-1, which is a variable pitch font but without anti-aliasing - with 7: -PfEd-DejaVu Sans-regular-normal-normal-*-29-*-*-*-*-0-iso10646-1, which is a variable pitch font - with 8-9: -ADBO-Source Code Pro-light-normal-normal-*-29-*-*-*-m-0-iso10646-1, which is again a monospace font - with 10-11: -PfEd-DejaVu Sans-ultralight-normal-normal-*-29-*-*-*-*-0-iso10646-1, which is a variable pitch font That can't be right. Only 4, 7, and 10-11 correspond to what is expected for that face, namely a variable pitch font. Fixing the 'medium' case (as my patch does) only improves 7. Fixing the other cases would amount to do something similar for each possible weight (e.g. "also try 'bold' after trying 'ultra-bold'"), which in fact amounts to ignoring the weight in spec. When the weight is ignored in font_find_for_lface, the variable-pitch face is realized as follows: - with 1-5: -PfEd-DejaVu Sans-bold-normal-normal-*-29-*-*-*-*-0-iso10646-1 - with 6-7: -PfEd-DejaVu Sans-regular-normal-normal-*-29-*-*-*-*-0-iso10646-1 - with 8-11: -PfEd-DejaVu Sans-ultralight-normal-normal-*-29-*-*-*-*-0-iso10646-1 Which is clearly TRT. New patch attached. --EBMEAP53xz Content-Type: text/x-diff; name=Unset-the-weight-in-font-specs-when-searching-for-a-.patch Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: attachment; filename=Unset-the-weight-in-font-specs-when-searching-for-a-.patch RnJvbSA3ZThmYjVjZWJkNDAzMWQ5NDc5NDBhZThlZWVmMGEyYjcyZmI0Y2Jh IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBNb24sIDIxIE5v diAyMDIyIDIzOjI2OjA3ICswMDAwDQpTdWJqZWN0OiBbUEFUQ0hdIFVuc2V0 IHRoZSB3ZWlnaHQgaW4gZm9udCBzcGVjcyB3aGVuIHNlYXJjaGluZyBmb3Ig YSBmb250Lg0KDQpCZXR3ZWVuIGNvbW1pdHMgYmYwZDNmNzZkYyAoMjAxNCkg YW5kIDZiMWVkMmYyYzkgKDIwMjIpLA0KcmVhbGl6ZV9ndWlfZmFjZSBjYWxs ZWQgZm9udF9sb2FkX2Zvcl9sZmFjZSB3aXRoIGFuIGVtcHR5IG9yIHBhcnRs eQ0KZW1wdGllZCBmb250IHNwZWMsIGkuZS4gaXQgaWdub3JlZCBhIHBhcnQg b2YgaXRzIGF0dHJzIGFyZ3VtZW50LiAgVGhlDQpyYXRpb25hbGUgZ2l2ZW4g aW4gYnVnIzE3OTczLCB3aGljaCBsZWQgdG8gYmYwZDNmNzZkYywgaXMgbm90 IGNsZWFyLg0KSG93ZXZlciwgNmIxZWQyZjJjOSBsZWFkcyB0byBzdWJvcHRp bWFsIGZvbnQgY2hvaWNlcyB3aGVuIHRoZSBmb250DQpjaG9zZW4gZm9yIHRo ZSBkZWZhdWx0IGZhY2UgaGFzIGEgd2VpZ2h0IHRoYXQgaXMgbm90IHN1cHBv cnRlZCBieQ0Kb3RoZXIgYXZhaWxhYmxlIGZvb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