[Bugfix] Make gpolonkai/set-font-size and --set-emoji-font work for text frames

This commit is contained in:
Gergely Polonkai 2019-03-29 07:50:02 +01:00
parent 1ce77f27c3
commit d4fca38e9e
1 changed files with 4 additions and 3 deletions

View File

@ -1059,12 +1059,13 @@ Before this can be used, make sure the [[https://zhm.github.io/symbola/][Symbola
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun gpolonkai/set-font-size (frame) (defun gpolonkai/set-font-size (frame)
(set-face-attribute 'default frame :font "Hack-12") (when (display-graphic-p frame)
(set-frame-font "Hack-12" t frame)) (set-face-attribute 'default frame :font "Hack-12")
(set-frame-font "Hack-12" t frame)))
(defun --set-emoji-font (frame) (defun --set-emoji-font (frame)
"Adjust the font setting of FRAME so Emacs can display Emoji properly." "Adjust the font setting of FRAME so Emacs can display Emoji properly."
(when (fboundp 'set-fontset-font) (when (display-graphic-p frame)
(set-fontset-font t 'symbol (set-fontset-font t 'symbol
(font-spec :family "Symbola") (font-spec :family "Symbola")
frame 'prepend))) frame 'prepend)))