1
0
Fork 0

Apply fontset settings when a frame is created, tweak font size

Instead of setting the fontset things immediately always, check if we’re running
as a daemon and if so, delay setting the fontsets until after a frame is
created. This will set the fontset for each frame individually.

Tweak the font size of the Font Awesome icons to fit better with the rest of the
fonts.
This commit is contained in:
Tom Willemse 2020-04-09 13:13:59 -07:00
parent afaa9d2a87
commit 734d5764f8

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2020.0408.234044
;; Version: 2020.0409.131343
;; Package-Requires: (oni-ui oni-hydra yoshi-theme diminish)
;; This program is free software; you can redistribute it and/or modify
@ -32,26 +32,31 @@
(defconst oni-gui-isearch-icon ?)
(set-fontset-font t oni-gui-isearch-icon "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(set-fontset-font t ? "Font Awesome 5 Free Solid")
(defun oni-gui-setup-fontsets (frame)
"Setup fontsets for FRAME.
If FRAME is nil, theyre set for the current frame."
(let ((font-awesome "Font Awesome 5 Free Solid-12"))
(set-fontset-font t oni-gui-isearch-icon font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame)
(set-fontset-font t ? font-awesome frame))
(let ((dejavu-sans-mono "DejaVu Sans Mono"))
(set-fontset-font t ?◉ dejavu-sans-mono frame)
(set-fontset-font t ?○ dejavu-sans-mono frame)
(set-fontset-font t ?✸ dejavu-sans-mono frame)
(set-fontset-font t ?✿ dejavu-sans-mono frame)))
(set-fontset-font t ?◉ "DejaVu Sans Mono")
(set-fontset-font t ?○ "DejaVu Sans Mono")
(set-fontset-font t ?✸ "DejaVu Sans Mono")
(set-fontset-font t ?✿ "DejaVu Sans Mono")
(diminish 'isearch-mode (string ?\s oni-gui-isearch-icon))
(with-eval-after-load 'isearch
(diminish 'isearch-mode (string ?\s oni-gui-isearch-icon)))
(defhydra oni-gui-hydra (:color teal :hint nil)
"
@ -70,6 +75,10 @@ _bi_: Auto Insert ^^ ^^
(scroll-bar-mode -1)
(if (daemonp)
(add-hook 'after-make-frame-functions #'oni-gui-setup-fontsets)
(oni-gui-setup-fontsets nil))
(global-unset-key (kbd "C-z"))
(global-set-key (kbd "C-c c") 'oni-gui-hydra/body)