From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Ponce Newsgroups: gmane.emacs.bugs Subject: bug#37473: 27.0.50; antialias setting is not preserved by, inheriting Date: Sun, 19 Jun 2022 18:43:33 +0200 Message-ID: <466d6eb8-b02f-9e49-6c79-95c5fa3d7252@orange.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21427"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Cc: Lars Ingebrigtsen To: 37473@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 19 18:44:13 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 1o2y21-0005Qv-AE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Jun 2022 18:44:13 +0200 Original-Received: from localhost ([::1]:33662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2y1z-0008HK-R2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Jun 2022 12:44:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2y1q-0008HB-P1 for bug-gnu-emacs@gnu.org; Sun, 19 Jun 2022 12:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2y1q-0005wd-H6 for bug-gnu-emacs@gnu.org; Sun, 19 Jun 2022 12:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o2y1q-0005E0-CK for bug-gnu-emacs@gnu.org; Sun, 19 Jun 2022 12:44:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: David Ponce Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Jun 2022 16:44:02 +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.165565701720045 (code B ref 37473); Sun, 19 Jun 2022 16:44:02 +0000 Original-Received: (at 37473) by debbugs.gnu.org; 19 Jun 2022 16:43:37 +0000 Original-Received: from localhost ([127.0.0.1]:52952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2y1R-0005DF-2U for submit@debbugs.gnu.org; Sun, 19 Jun 2022 12:43:37 -0400 Original-Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:62764 helo=smtp.smtpout.orange.fr) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2y1P-0005D6-Gv for 37473@debbugs.gnu.org; Sun, 19 Jun 2022 12:43:36 -0400 Original-Received: from [192.168.1.15] ([2.7.231.82]) by smtp.orange.fr with ESMTPA id 2y1NotP4LJXxR2y1NoWpo8; Sun, 19 Jun 2022 18:43:33 +0200 X-ME-Helo: [192.168.1.15] X-ME-Auth: OWU0YmVhODllOThlNTBiMTcxZWVkMmNjZmQ4ZWZlMmRlNQ== X-ME-Date: Sun, 19 Jun 2022 18:43:33 +0200 X-ME-IP: 2.7.231.82 Content-Language: fr 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:234807 Archived-At: Hello, The below related today's commit to xface.c breaks antialiasing: From b2d11d69dd49864874f8fe53669b4049e83bfce9 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 19 Jun 2022 21:57:11 +0800 Subject: More conservative fix for bug#37473 * src/xfaces.c (realize_gui_face): Add more conservative fix, since the last change makes C-x C-+ lead to weight weirdness on my machine. --- src/xfaces.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/xfaces.c b/src/xfaces.c index 4242205..25b5e4d 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5909,7 +5909,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] #ifdef HAVE_WINDOW_SYSTEM struct face *default_face; struct frame *f; - Lisp_Object stipple, underline, overline, strike_through, box; + Lisp_Object stipple, underline, overline, strike_through, box, temp_spec; eassert (FRAME_WINDOW_P (cache->f)); @@ -5953,17 +5953,18 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) { /* We want attrs to allow overriding most elements in the - spec, but we don't want to start with an all-nil font, - either, because then we lose attributes like - antialiasing. This should probably be fixed in a - different way, see bug#17973 and bug#37473. */ - Lisp_Object spec = copy_font_spec (attrs[LFACE_FONT_INDEX]); - Ffont_put (spec, QCfoundry, Qnil); - Ffont_put (spec, QCfamily, Qnil); - Ffont_put (spec, QCregistry, Qnil); - Ffont_put (spec, QCadstyle, Qnil); + 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); + + if (FONTP (attrs[LFACE_FONT_INDEX])) + Ffont_put (temp_spec, QCantialias, + Ffont_get (attrs[LFACE_FONT_INDEX], + QCantialias)); + attrs[LFACE_FONT_INDEX] - = font_load_for_lface (f, attrs, spec); + = font_load_for_lface (f, attrs, temp_spec); } if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) { -- cgit v1.1 The below marked line seems not correct. According to the previous condition "if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))", it should always be false, so the antialising attibute is never preserved: if (FONTP (attrs[LFACE_FONT_INDEX])) <===================== Ffont_put (temp_spec, QCantialias, Ffont_get (attrs[LFACE_FONT_INDEX], QCantialias)); Thanks, David Ponce