From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Protesilaos Stavrou Newsgroups: gmane.emacs.bugs Subject: bug#45920: 28.0.50; set-face-attribute cannot read :family when different :weight exist Date: Sat, 16 Jan 2021 23:02:24 +0200 Message-ID: <871rekppcv.fsf@protesilaos.com> References: <875z3wprsd.fsf@protesilaos.com> <83pn248w8o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9944"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45920@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 16 22:03:10 2021 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 1l0sj0-0002Vg-Az for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Jan 2021 22:03:10 +0100 Original-Received: from localhost ([::1]:40378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0siz-0004ZY-Dv for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Jan 2021 16:03:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0sis-0004ZC-Uy for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2021 16:03:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0sir-0000eL-Ug for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2021 16:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l0sir-0008EP-QQ for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2021 16:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Protesilaos Stavrou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jan 2021 21:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45920 X-GNU-PR-Package: emacs Original-Received: via spool by 45920-submit@debbugs.gnu.org id=B45920.161083095731607 (code B ref 45920); Sat, 16 Jan 2021 21:03:01 +0000 Original-Received: (at 45920) by debbugs.gnu.org; 16 Jan 2021 21:02:37 +0000 Original-Received: from localhost ([127.0.0.1]:44120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0siS-0008Dj-IX for submit@debbugs.gnu.org; Sat, 16 Jan 2021 16:02:36 -0500 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:61911) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0siP-0008DT-Fi for 45920@debbugs.gnu.org; Sat, 16 Jan 2021 16:02:35 -0500 X-Originating-IP: 94.46.225.161 Original-Received: from kronos (unknown [94.46.225.161]) (Authenticated sender: public@protesilaos.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 020E640005; Sat, 16 Jan 2021 21:02:26 +0000 (UTC) In-Reply-To: <83pn248w8o.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Jan 2021 22:25:43 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:198037 Archived-At: On 2021-01-16, 22:25 +0200, Eli Zaretskii wrote: >> From: Protesilaos Stavrou >> Date: Sat, 16 Jan 2021 22:09:54 +0200 >> >> ;; Sample 1 >> (set-face-attribute 'default nil >> :family "Source Code Pro" >> :weight 'light) >> >> ;; Sample 2 >> (set-face-attribute 'default nil >> :family "Hack" >> :weight 'normal) >> >> If you evaluate sample 1, you will get the desired behaviour. Namely, >> the font family for the default face is the one specified, as is the >> typographic weight. >> >> Now if you proceed to evaluate sample 2, you will notice that only the >> weight gets updated. The family continues to be that of sample 1. >> >> At this point, to get the family of sample 2, you need to evaluate >> sample 2 one more time. >> >> I tried various combinations and my impression is that the problem >> occurs when the :weight properties are different. Other properties, >> such as :height, do not exhibit this behaviour. > > I didn't try to reproduce, because I don't have one of these fonts. > However, it might be relevant that when you call set-face-attribute > with several attributes related to the face's font, the underlying > primitive, internal-set-lisp-face-attribute, is called multiple time, > one time for every attribute. So the order of those calls might > matter, especially if one of the fonts doesn't support some of the > values of all the attributes (e.g., the 'normal' weight in this case). Thank you Eli for the prompt reply! Following your input, I tried alternating between those two and they both give me the right results: (progn (internal-set-lisp-face-attribute 'default :family "Source Code Pro" 0) (internal-set-lisp-face-attribute 'default :weight 'light 0)) (progn (internal-set-lisp-face-attribute 'default :weight 'normal 0) (internal-set-lisp-face-attribute 'default :family "Hack" 0)) Please feel free to close this. -- Protesilaos Stavrou protesilaos.com