From 772c0e6f20f789862883e42181dd16a6ac3cb0f6 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 20 Jun 2022 09:16:41 +0800 Subject: [PATCH] Fix earlier change in xfaces.c for antialiasing in the mode line * src/xfaces.c (realize_gui_face): Don't put QCantialias in empty spec if it doesn't exist in the original. --- src/xfaces.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/xfaces.c b/src/xfaces.c index 25b5e4d185c..f70fe87c95e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5910,6 +5910,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] struct face *default_face; struct frame *f; Lisp_Object stipple, underline, overline, strike_through, box, temp_spec; + Lisp_Object temp_extra, antialias; eassert (FRAME_WINDOW_P (cache->f)); @@ -5957,11 +5958,18 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] 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 (FONTP (attrs[LFACE_FONT_INDEX])) - Ffont_put (temp_spec, QCantialias, - Ffont_get (attrs[LFACE_FONT_INDEX], - QCantialias)); + 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); -- 2.39.2