unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: luangruo@yahoo.com, handa@gnu.org, larsi@gnus.org
Cc: da_vid@orange.fr, 37473@debbugs.gnu.org,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#37473: 27.0.50; antialias setting is not preserved by, inheriting
Date: Mon, 20 Jun 2022 17:11:49 +0300	[thread overview]
Message-ID: <83wndbl90a.fsf@gnu.org> (raw)
In-Reply-To: <83y1xrlalf.fsf@gnu.org> (message from Eli Zaretskii on Mon, 20 Jun 2022 16:37:32 +0300)

> 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 <eliz@gnu.org>
> 
> > From: Po Lu <luangruo@yahoo.com>
> > 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 <eliz@gnu.org> 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]);





  reply	other threads:[~2022-06-20 14:11 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 ` bug#37473: 27.0.50; antialias setting is not preserved by, inheriting David Ponce
2022-06-19 18:28   ` 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 [this message]
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=83wndbl90a.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=37473@debbugs.gnu.org \
    --cc=da_vid@orange.fr \
    --cc=handa@gnu.org \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    --cc=monnier@iro.umontreal.ca \
    /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).