[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

View File

@ -1059,12 +1059,13 @@ Before this can be used, make sure the [[https://zhm.github.io/symbola/][Symbola
#+BEGIN_SRC emacs-lisp
(defun gpolonkai/set-font-size (frame)
(set-face-attribute 'default frame :font "Hack-12")
(set-frame-font "Hack-12" t frame))
(when (display-graphic-p frame)
(set-face-attribute 'default frame :font "Hack-12")
(set-frame-font "Hack-12" t frame)))
(defun --set-emoji-font (frame)
"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
(font-spec :family "Symbola")
frame 'prepend)))