]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix earlier change in xfaces.c for antialiasing in the mode line
authorPo Lu <luangruo@yahoo.com>
Mon, 20 Jun 2022 01:16:41 +0000 (09:16 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 20 Jun 2022 01:16:41 +0000 (09:16 +0800)
* src/xfaces.c (realize_gui_face): Don't put QCantialias in
empty spec if it doesn't exist in the original.

src/xfaces.c

index 25b5e4d185c0a8480b6dde62748401c425acba26..f70fe87c95e50b4466fa91e9517b24eb5a5384fc 100644 (file)
@@ -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);