aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2022-08-27 13:13:48 +0300
committerEli Zaretskii2022-08-27 13:13:48 +0300
commit6b1ed2f2c99a1c2da56c5f434570c438cad6576d (patch)
tree2bb9e97bc4d19f57b929a594a451738a9eddbdb5 /src
parentd19c7042b21c6b1ba47cd4ecfb3f1938a6faabb7 (diff)
downloademacs-6b1ed2f2c99a1c2da56c5f434570c438cad6576d.tar.gz
emacs-6b1ed2f2c99a1c2da56c5f434570c438cad6576d.zip
Fix antialias face attribute when text is scaled
This restores the code we had in realize_gui_face before commit bf0d3f7. The problem described in bug#17973, 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 backing out that part of commit bf0d3f7 is TRT, 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. * src/xfaces.c (realize_gui_face): Preserve face attributes when text is scaled. This reverts part of the changes installed in commit bf0d3f7. (Bug#37473)
Diffstat (limited to 'src')
-rw-r--r--src/xfaces.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index bbc1d352c6e..70d5cbeb4c7 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6012,8 +6012,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
6012#ifdef HAVE_WINDOW_SYSTEM 6012#ifdef HAVE_WINDOW_SYSTEM
6013 struct face *default_face; 6013 struct face *default_face;
6014 struct frame *f; 6014 struct frame *f;
6015 Lisp_Object stipple, underline, overline, strike_through, box, temp_spec; 6015 Lisp_Object stipple, underline, overline, strike_through, box;
6016 Lisp_Object temp_extra, antialias;
6017 6016
6018 eassert (FRAME_WINDOW_P (cache->f)); 6017 eassert (FRAME_WINDOW_P (cache->f));
6019 6018
@@ -6055,28 +6054,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
6055 emacs_abort (); 6054 emacs_abort ();
6056 } 6055 }
6057 if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) 6056 if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
6058 { 6057 attrs[LFACE_FONT_INDEX]
6059 /* We want attrs to allow overriding most elements in the 6058 = font_load_for_lface (f, attrs, attrs[LFACE_FONT_INDEX]);
6060 spec (IOW, to start out as an empty font spec), but
6061 preserve the antialiasing attribute. (bug#17973,
6062 bug#37473). */
6063 temp_spec = Ffont_spec (0, NULL);
6064 temp_extra = AREF (attrs[LFACE_FONT_INDEX],
6065 FONT_EXTRA_INDEX);
6066 /* If `:antialias' wasn't specified, keep it unspecified
6067 instead of changing it to nil. */
6068
6069 if (CONSP (temp_extra))
6070 antialias = Fassq (QCantialias, temp_extra);
6071 else
6072 antialias = Qnil;
6073
6074 if (FONTP (attrs[LFACE_FONT_INDEX]) && !NILP (antialias))
6075 Ffont_put (temp_spec, QCantialias, Fcdr (antialias));
6076
6077 attrs[LFACE_FONT_INDEX]
6078 = font_load_for_lface (f, attrs, temp_spec);
6079 }
6080 if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) 6059 if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
6081 { 6060 {
6082 face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]); 6061 face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]);