emacs-diffs
[Top][All Lists]
Advanced

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

master c5c29a9: Fix font-panel on NS (bug#43480)


From: Alan Third
Subject: master c5c29a9: Fix font-panel on NS (bug#43480)
Date: Tue, 22 Sep 2020 08:40:19 -0400 (EDT)

branch: master
commit c5c29a9f0f60321304125a1f3b991ce724d868cc
Author: David Reitter <david.reitter@gmail.com>
Commit: Alan Third <alan@idiocy.org>

    Fix font-panel on NS (bug#43480)
    
    * lisp/term/ns-win.el (ns-respond-to-change-font): Set the font using
    customize.
---
 lisp/term/ns-win.el | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 6acf6cd..dd0a986 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -632,15 +632,21 @@ This function has been overloaded in Nextstep.")
 (defvar ns-input-fontsize)
 
 (defun ns-respond-to-change-font ()
-  "Respond to changeFont: event, expecting `ns-input-font' and\n\
-`ns-input-fontsize' of new font."
+  "Set the font chosen in the font-picker panel.
+Respond to changeFont: event, expecting ns-input-font and
+ns-input-fontsize of new font."
   (interactive)
-  (modify-frame-parameters (selected-frame)
-                           (list (cons 'fontsize ns-input-fontsize)))
-  (modify-frame-parameters (selected-frame)
-                           (list (cons 'font ns-input-font)))
-  (set-frame-font ns-input-font))
-
+  (let ((face 'default))
+    (set-face-attribute face t
+                        :family ns-input-font
+                        :height (* 10 ns-input-fontsize))
+    (set-face-attribute face (selected-frame)
+                        :family ns-input-font
+                        :height (* 10 ns-input-fontsize))
+    (let ((spec (list (list t (face-attr-construct 'default)))))
+      (put face 'customized-face spec)
+      (custom-push-theme 'theme-face face 'user 'set spec)
+      (put face 'face-modified nil))))
 
 ;; Default fontset for macOS.  This is mainly here to show how a fontset
 ;; can be set up manually.  Ordinarily, fontsets are auto-created whenever



reply via email to

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