mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-30 19:53:09 +00:00
Fix antialias face attribute when text is scaled
This restores the code we had in realize_gui_face before commitbf0d3f7
. 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 commitbf0d3f7
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 commitbf0d3f7
. (Bug#37473)
This commit is contained in:
parent
d19c7042b2
commit
6b1ed2f2c9
27
src/xfaces.c
27
src/xfaces.c
@ -6012,8 +6012,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, temp_spec;
|
||||
Lisp_Object temp_extra, antialias;
|
||||
Lisp_Object stipple, underline, overline, strike_through, box;
|
||||
|
||||
eassert (FRAME_WINDOW_P (cache->f));
|
||||
|
||||
@ -6055,28 +6054,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]);
|
||||
|
Loading…
Reference in New Issue
Block a user