emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 37f168afdd: Don't lose antialiasing info when hitting `C-x C-+'


From: Lars Ingebrigtsen
Subject: master 37f168afdd: Don't lose antialiasing info when hitting `C-x C-+'
Date: Sun, 19 Jun 2022 09:03:13 -0400 (EDT)

branch: master
commit 37f168afdd272d4094da9a975425e797f253e63b
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Don't lose antialiasing info when hitting `C-x C-+'
    
    * src/xfaces.c (realize_gui_face): Don't lose antialiasing info
    when hitting `C-x C-+' (bug#37473).
---
 src/xfaces.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/xfaces.c b/src/xfaces.c
index 04e5439d9d..424220591b 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5951,8 +5951,20 @@ realize_gui_face (struct face_cache *cache, Lisp_Object 
attrs[LFACE_VECTOR_SIZE]
            emacs_abort ();
        }
       if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
-       attrs[LFACE_FONT_INDEX]
-         = font_load_for_lface (f, attrs, Ffont_spec (0, NULL));
+       {
+         /* We want attrs to allow overriding most elements in the
+            spec, but we don't want to start with an all-nil font,
+            either, because then we lose attributes like
+            antialiasing.  This should probably be fixed in a
+            different way, see bug#17973 and bug#37473.  */
+         Lisp_Object spec = copy_font_spec (attrs[LFACE_FONT_INDEX]);
+         Ffont_put (spec, QCfoundry, Qnil);
+         Ffont_put (spec, QCfamily, Qnil);
+         Ffont_put (spec, QCregistry, Qnil);
+         Ffont_put (spec, QCadstyle, Qnil);
+         attrs[LFACE_FONT_INDEX]
+           = font_load_for_lface (f, attrs, spec);
+       }
       if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
        {
          face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]