add fg42-font function and get-fg42-font function to get fg42 font if set by user or the default one

This commit is contained in:
amirrezaask 2020-02-23 19:09:27 +03:30
parent 6c9dfd0a57
commit 9c6c3aab5b
3 changed files with 11 additions and 3 deletions

View File

@ -58,8 +58,8 @@
;; Font Configuration -----------------------------------
(ability fira-font ()
"Sets the default font to Fira Mono"
(add-to-list 'default-frame-alist '(font . "Fira Mono"))
(set-face-attribute 'default t :font "Fira Mono"))
(add-to-list 'default-frame-alist '(font . (get-fg42-font)))
(set-face-attribute 'default t :font (get-fg42-font)))
;; ------------------------------------------------------
(cheatsheet-add :group '--HELP--

View File

@ -42,5 +42,4 @@ it inserts comment at the end of the line."
(interactive) (join-line -1))))
(provide 'extensions/editor/utils)

View File

@ -65,6 +65,15 @@ with is the buffer."
"Apply the given FACE-SYMBOL to the given TEXT."
(put-text-property 0 (length text) 'face face-symbol text))
(setq fg42--default-font "Fira Mono")
(defvar fg42-font "" "FG42 font set by user")
(defun fg42-font (font)
(setq fg42-font font))
(defun get-fg42-font ()
(if fg42-font fg42-font fg42--default-font))
(provide 'fg42/utils)
;;; utils.el ends here