From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#59347: 29.0.50; `:family` face setting ignored Date: Wed, 7 Dec 2022 21:32:48 -0800 Message-ID: <066E73C7-E991-45B6-A5B8-BB164AFEE1BF@gmail.com> References: <83tu2t4ie9.fsf@gnu.org> <7cc9e03786e324ff82ef@heytings.org> <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> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10393"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gregory Heytings , Eli Zaretskii , 59347@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 08 06:33:25 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 1p39XA-0002Vi-4Y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 06:33:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p39Wp-0008Da-N1; Thu, 08 Dec 2022 00:33:03 -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 1p39Wo-0008DL-Ge for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 00:33:02 -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 1p39Wo-0002Nz-7e for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 00:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p39Wn-0001W7-NG for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 00:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Dec 2022 05:33:01 +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.16704775795825 (code B ref 59347); Thu, 08 Dec 2022 05:33:01 +0000 Original-Received: (at 59347) by debbugs.gnu.org; 8 Dec 2022 05:32:59 +0000 Original-Received: from localhost ([127.0.0.1]:54399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p39Wl-0001Vt-8l for submit@debbugs.gnu.org; Thu, 08 Dec 2022 00:32:59 -0500 Original-Received: from mail-pg1-f177.google.com ([209.85.215.177]:41966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p39Wj-0001Vn-5O for 59347@debbugs.gnu.org; Thu, 08 Dec 2022 00:32:58 -0500 Original-Received: by mail-pg1-f177.google.com with SMTP id q71so350956pgq.8 for <59347@debbugs.gnu.org>; Wed, 07 Dec 2022 21:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3Hf4VO5VybLrD0gonulRl03pAG4xdQQJlQTOZkFe/ws=; b=Q6TNx7ggmB7vzbKsnmYIbC+ZuMg04DahmTlfi2J1/1Gop8nnFHllqb1TqHR9PXwazd qbnb/oWJK+4NMAnrFFeTcTpbMfXGE6BEOeXTRvYjGk3215H6nQgX+Y6F3hfKHOGqwRPN AcdCwyQ3fUcbFPIKCRhtJOStXpc2xbJSNsjTXFpBjuRZL+4jbZ0Tc/OVqfF9s3VQj1ES wUb8y/hgnRiaVLG3Nck5DYey7ZrHGuGfe5S8ThlT0Z4SOtb1/w0I0eCv0OjrkBltFc39 DN364PlgDtPlsDcp78Rp3zezKPAdjjwDpB769XLMinUM0d6gf4v639xK+aSX+cEUepB2 0tXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Hf4VO5VybLrD0gonulRl03pAG4xdQQJlQTOZkFe/ws=; b=VVS7F5UhSKcqtcqUJOgrWhmtPIcH0k3+hCzVl0vLHlKu0BPM/Yy6kvsqTMugKKdvPQ ejEsm9zu+1awzwG9VFc8ktDPOreIq+2kNZvMWgMhEZwSoOoqZc5LW23TWk1Wi4o+fTr7 bmbIlDWTzkHDkzb9z+IeII28J6E+YT9x2hgiWvbVE21ziaFk+NQ8fG2iD1LDH71M51IK 9gTfXQs5lVH4xxOI0ofYUphVuF51xAcHE9JwP2MMxvbtvU+H8fEKj1DvdInsDRCtPSx1 G2EZP/SpdJg5oOP7FbcjWel/uV1/rlHYRJ17vDQl+QrNZdP0iJbcxEF7pJ5KZvnWsLrM 2y7w== X-Gm-Message-State: ANoB5pkhPfjbQZfd/CkOcKC3xzqZv4MMNVuaTtWEMARcFCjCKEfA8avu CANI/EjLPYauAWtEYC/gy0A= X-Google-Smtp-Source: AA0mqf7O2p+clObtvPZ/H0eio3qtNYeia7NT3140Mv38rQKSvgsiyshzxoe0eRx8QxZANAn6QtRAIw== X-Received: by 2002:a62:ee0d:0:b0:573:1d31:2b87 with SMTP id e13-20020a62ee0d000000b005731d312b87mr1352385pfi.31.1670477570979; Wed, 07 Dec 2022 21:32:50 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id l124-20020a622582000000b00573eb4a9a66sm14440115pfl.2.2022.12.07.21.32.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2022 21:32:50 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) 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:250239 Archived-At: > On Dec 7, 2022, at 4:27 PM, Stefan Monnier via Bug reports for GNU = Emacs, the Swiss army knife of text editors = wrote: >=20 >>> My question was not about this basic relative importance, it was = about >>> something else: when none of the fonts of the given FAMILY fits the = font >>> spec, why do you consider keeping the family to be more important = than >>> keeping the weight? >> I don't understand your question. If we agree that there is an order = of >> importance in the attributes of a font spec, >=20 > Why should we agree on that? >=20 > When I specify the `:family` property on the `variable-pitch` face, > I definitely want it to take precedence over the `:weight` of the > default face, yes. >=20 > 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. >=20 > FWIW, I've been running with your patch and I like the result. I = think > it's better overall, but I suspect that we still have a fundamental > problem with this notion of precedence/ordering. >=20 > Maybe the ordering should depend on the "stacking order" of the faces > and their properties. I.e. instead of merging = `bold+variable-pitch+default` to get > a set of properties on which we apply a globally-imposed ordering, we > could keep track of the relative ordering of the properties: `bold` = was > on top, so the `:weight` property comes first, then came > `variable-pitch` so its `:family` property comes second and the second > comes afterwards. >=20 > So `bold+variable-pitch+default` could result in a different font than > `variable-pitch+bold+default` even if the combined properties (i.e. = the > merged face) are identical. IIUC currently all faces are realized into a =E2=80=9Crealized face=E2=80=9D= , where each attribute is filled in with parent faces=E2=80=99 = attributes. So there is no difference between an explicitly assigned = attribute and an inherited attribute at the time when Emacs selects = fonts. But if I assign only :family attribute to a face, and that face = inherits a :weight attribute, naturally the :family face should take = precedence when selecting fonts. OTOH if I explicitly assign a :weight = attribute, and the :family attribute is inherited, then :weight should = probably take precedence. IIUC you are just describing a generalized version of this strategy, = right? I think it=E2=80=99s a good idea. Even if we don=E2=80=99t = generalize it into a =E2=80=9Cstacking order=E2=80=9D, but only record = what=E2=80=99s inherited and what=E2=80=99s assigned explicitly, and = prioritize the explicitly assigned attributes, it would produce more = intuitive results, I think. Yuan=