unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: David Ponce <da_vid@orange.fr>
To: 37473@debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi@gnus.org>
Subject: bug#37473: 27.0.50; antialias setting is not preserved by, inheriting
Date: Sun, 19 Jun 2022 18:43:33 +0200	[thread overview]
Message-ID: <466d6eb8-b02f-9e49-6c79-95c5fa3d7252@orange.fr> (raw)
In-Reply-To: <wl36gq9t7a.wl-mituharu@math.s.chiba-u.ac.jp>

Hello,

The below related today's commit to xface.c breaks antialiasing:

 From b2d11d69dd49864874f8fe53669b4049e83bfce9 Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@yahoo.com>
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





  parent reply	other threads:[~2022-06-19 16:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-21  4:19 bug#37473: 27.0.50; antialias setting is not preserved by inheriting YAMAMOTO Mitsuharu
2022-05-20 10:42 ` Lars Ingebrigtsen
2022-06-19 13:02   ` Lars Ingebrigtsen
2022-06-19 16:43 ` David Ponce [this message]
2022-06-19 18:28   ` bug#37473: 27.0.50; antialias setting is not preserved by, inheriting Colin Baxter
2022-06-19 19:14   ` Eli Zaretskii
2022-06-19 22:47     ` Lars Ingebrigtsen
2022-06-20  0:49     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-20 11:57       ` Eli Zaretskii
2022-06-20 12:04         ` Lars Ingebrigtsen
2022-06-20 12:11           ` Eli Zaretskii
2022-06-20 12:20         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-20 13:16           ` Eli Zaretskii
2022-06-20 13:20             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-20 13:37               ` Eli Zaretskii
2022-06-20 14:11                 ` Eli Zaretskii
2022-06-20 15:43                   ` Lars Ingebrigtsen
2022-06-20 15:57                     ` Eli Zaretskii
2022-06-30  6:17                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=466d6eb8-b02f-9e49-6c79-95c5fa3d7252@orange.fr \
    --to=da_vid@orange.fr \
    --cc=37473@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).