From c5c29a9f0f60321304125a1f3b991ce724d868cc Mon Sep 17 00:00:00 2001 From: David Reitter Date: Tue, 22 Sep 2020 13:38:16 +0100 Subject: [PATCH] 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 6acf6cd1992..dd0a986572d 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 -- 2.39.2