From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#37473: 27.0.50; antialias setting is not preserved by, inheriting Date: Mon, 20 Jun 2022 17:11:49 +0300 Message-ID: <83wndbl90a.fsf@gnu.org> References: <466d6eb8-b02f-9e49-6c79-95c5fa3d7252@orange.fr> <83k09cmpn6.fsf@gnu.org> <87wndcxipc.fsf@yahoo.com> <837d5bmtso.fsf@gnu.org> <875ykvo7bd.fsf@yahoo.com> <831qvjmq5h.fsf@gnu.org> <87y1xrlbee.fsf@yahoo.com> <83y1xrlalf.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30804"; mail-complaints-to="usenet@ciao.gmane.io" Cc: da_vid@orange.fr, 37473@debbugs.gnu.org, Stefan Monnier To: luangruo@yahoo.com, handa@gnu.org, larsi@gnus.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 20 16:13:21 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 1o3I9Z-0007sW-Ar for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Jun 2022 16:13:21 +0200 Original-Received: from localhost ([::1]:36978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3I9Y-0004IC-8M for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Jun 2022 10:13:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3I9G-0004Df-6C for bug-gnu-emacs@gnu.org; Mon, 20 Jun 2022 10:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3I9F-0007vQ-TH for bug-gnu-emacs@gnu.org; Mon, 20 Jun 2022 10:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3I9F-0004dz-OA for bug-gnu-emacs@gnu.org; Mon, 20 Jun 2022 10:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Jun 2022 14:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37473 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 37473-submit@debbugs.gnu.org id=B37473.165573433817738 (code B ref 37473); Mon, 20 Jun 2022 14:13:01 +0000 Original-Received: (at 37473) by debbugs.gnu.org; 20 Jun 2022 14:12:18 +0000 Original-Received: from localhost ([127.0.0.1]:58096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3I8X-0004c0-Ua for submit@debbugs.gnu.org; Mon, 20 Jun 2022 10:12:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3I8U-0004bj-KM for 37473@debbugs.gnu.org; Mon, 20 Jun 2022 10:12:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3I8K-0007lr-5B; Mon, 20 Jun 2022 10:12:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=B2d7Gw6ljlUDhdQF8lsEN+kb8rSmseGaUpZFF/RrZew=; b=e3HZW1mu1/GY JK0jnyUKjw+vWkXDVk5qf9xAWi633uk3j5sSf2qu0NjMzTJDdihYgVWDFPqNogecpVoOt0r4LbouH RXZCkEV4rGkbI8JlE0UyfyOLm9LMzBnYGBfGqQzfEE58vYiCnRZhJn4t8RSWn3lGVyxellgIo8d2T CSqF/v50olyrwbDyv+sQjEfjvTMNZ87LHqD1+49SIYQLJ6WhMzAWwRH8jA68abq0mYPosBaTtVYd0 aCV6CC8iNwfo6stOXefsHrsYGRxa6KFIUNfVne4NCp3+4rWERwan943B99GgJr/Qocx2YWQ0O65Nn ScVD6GymIljfOUcxDxrpUQ==; Original-Received: from [87.69.77.57] (port=2578 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3I8J-0004q3-JV; Mon, 20 Jun 2022 10:12:03 -0400 In-Reply-To: <83y1xrlalf.fsf@gnu.org> (message from Eli Zaretskii on Mon, 20 Jun 2022 16:37:32 +0300) 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:234900 Archived-At: > Cc: handa@gnu.org, larsi@gnus.org, 37473@debbugs.gnu.org, da_vid@orange.fr > Date: Mon, 20 Jun 2022 16:37:32 +0300 > From: Eli Zaretskii > > > From: Po Lu > > Cc: handa@gnu.org, da_vid@orange.fr, 37473@debbugs.gnu.org, larsi@gnus.org > > Date: Mon, 20 Jun 2022 21:20:09 +0800 > > > > Eli Zaretskii writes: > > > > > ??? The original bug report talked about antialiasing, but it didn't > > > say that other attributes in the :extra property don't exhibit the > > > same issue. > > > > They might, but apparently :antialias is the only one to have caused > > enough of a problem for someone to open a bug report. > > > > I guess copying the entire extras alist would work too, if that's what > > you would prefer. > > Yes, I think that's what we should do, at least as long as the > solution is based on this technique. Actually, why not go to the code we had in realize_gui_face before commit bf0d3f7? The problem described in bug#1793, which led to that commit, only happens if one uses a specific (misc-fixed) font family, not for the usual default fonts used by Emacs, and I'm not sure what's described there is a bug at all. At least for the purposes of text-scale-adjust, it makes no sense to ignore the foundry/family/adstyle of the original font, because we _want_ the same (or very similar) font, just of a different size. And likely in other use cases: if the :font attribute of a face specifies some font properties, we want to keep them all, not arbitrarily to ignore some of them. And definitely catering to an obscure use case such as the one cited in bug#17973 is NOT a good reason to make such radical changes in face-realization behavior. So I think we should just back out that part of commit bf0d3f7, and if we decide that this causes bug#17973 in too many situations we care about, I'd rather find a kludge for that specific case than do that for every face realization. Specifically, I propose the change for the master branch. Any objections? diff --git a/src/xfaces.c b/src/xfaces.c index f70fe87..10bde40 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5952,28 +5952,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] emacs_abort (); } if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) - { - /* We want attrs to allow overriding most elements in the - spec (IOW, to start out as an empty font spec), but - preserve the antialiasing attribute. (bug#17973, - bug#37473). */ - temp_spec = Ffont_spec (0, NULL); - temp_extra = AREF (attrs[LFACE_FONT_INDEX], - FONT_EXTRA_INDEX); - /* If `:antialias' wasn't specified, keep it unspecified - instead of changing it to nil. */ - - if (CONSP (temp_extra)) - antialias = Fassq (QCantialias, temp_extra); - else - antialias = Qnil; - - if (FONTP (attrs[LFACE_FONT_INDEX]) && !NILP (antialias)) - Ffont_put (temp_spec, QCantialias, Fcdr (antialias)); - - attrs[LFACE_FONT_INDEX] - = font_load_for_lface (f, attrs, temp_spec); - } + attrs[LFACE_FONT_INDEX] + = font_load_for_lface (f, attrs, attrs[LFACE_FONT_INDEX]); if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) { face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]);