From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59347: 29.0.50; `:family` face setting ignored Date: Thu, 08 Dec 2022 09:17:12 -0500 Message-ID: References: <83bkp04gjl.fsf@gnu.org> <83leo42vm9.fsf@gnu.org> <0d1ea3007fd94b7ae0b1@heytings.org> <83r0xv1649.fsf@gnu.org> <0d1ea3007f532a493429@heytings.org> <83cz9f12bh.fsf@gnu.org> <835yewleyn.fsf@gnu.org> <83tu2b9rlx.fsf@gnu.org> <83k0347gtu.fsf@gnu.org> <83tu262u5l.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35020"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: gregory@heytings.org, 59347@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 08 15:18:09 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 1p3Hiz-0008mb-Ia for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 15:18:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3Hiw-0002Q9-Id; Thu, 08 Dec 2022 09:18: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 1p3Hit-0002Pt-V6 for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 09:18:04 -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 1p3Hit-0003h7-EB for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 09:18:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3His-0003Tv-9o for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 09:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Dec 2022 14: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.167050904113374 (code B ref 59347); Thu, 08 Dec 2022 14:18:02 +0000 Original-Received: (at 59347) by debbugs.gnu.org; 8 Dec 2022 14:17:21 +0000 Original-Received: from localhost ([127.0.0.1]:57056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3HiD-0003Te-Ey for submit@debbugs.gnu.org; Thu, 08 Dec 2022 09:17:21 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:54780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3HiC-0003TX-4l for 59347@debbugs.gnu.org; Thu, 08 Dec 2022 09:17:20 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8C2D8100123; Thu, 8 Dec 2022 09:17:14 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DB4E7100084; Thu, 8 Dec 2022 09:17:12 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1670509032; bh=cgr0ltAzX/G2aa2mj2KLYarYrCOVBUamnUYuD2x+VCk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=F9L9WFfo9p71J4RyKff4+34UEOPgeJ+BEe2ZdBVJeQxbtz2RRaI8AMtK8D03VtO4m 7qCSXfjPxW/AYKNx3kEpaMZU+dtCFS3OOUj6Jz9sOBUH9Fp6TqOSbttQXXlR3Pafty 5n8iaOyH8CSZbjA9zv7hGp1Jo4hDbw8b13WPWUsSpmImOn1VNdElwgj3TugH+64C64 vmUPBBngNIxGajhZIPELB+rEVkYcB0MZ5JYuLQXEsh6nx7cnNxghQFyAESXqYaJEj7 90BzdxM9cdBR0655LMqUdTgwnwcOaTjGbxMLq8CBOorY2baQvDlYjOtiqZzA9zpDNW jdVqs2k9ziPzg== Original-Received: from pastel (unknown [45.72.193.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8E14A120FD8; Thu, 8 Dec 2022 09:17:12 -0500 (EST) In-Reply-To: <83tu262u5l.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 08 Dec 2022 10:09:58 +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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250291 Archived-At: >> But when I specify the `weight` property of the `bold` face, it's not >> clear at all that the `:family` of the default face should take precedence >> over the `:weight` of the `bold` face. > > If we want to distinguish between explicitly requested attributes and > inherited attributes, we need to store this information inside the > font spec. (We have the :user-spec attribute, but it is used for > slightly different purposes.) Indeed. >> FWIW, I've been running with your patch and I like the result. > > Which patch is that? The one proposed in the message to which you are > responding, or one of the earlier ones? See the hunk below. > How would you determine the order in the stack? IOW, which attributes > will be "the first"? For attributes specified directly in a face the relative order is not specified, but attributes directly specified would come before inherited attributes, and similarly when we merge several faces, attributes from the first face would come before those of later faces. Stefan @@ -3003,6 +3012,10 @@ font_find_for_lface (struct frame *f, Lisp_Object *attrs, Lisp_Object spec, int } ASET (work, FONT_SIZE_INDEX, Qnil); + /* Also ignore the font weight, which when set leads to suboptimal + font choices. See bug#59347. */ + ASET (work, FONT_WEIGHT_INDEX, Qnil); + /* Foundry specification alternatives: from the most specific to the least specific and finally an unspecified one. */ foundry[0] = AREF (work, FONT_FOUNDRY_INDEX);