2018-05-25 00:46:11 +02:00
|
|
|
;;; ui/unicode/autoload.el -*- lexical-binding: t; -*-
|
|
|
|
|
2020-06-12 12:45:37 -04:00
|
|
|
;;;###autoload
|
|
|
|
(defun +unicode--add-doom-unicode-font ()
|
|
|
|
"Include doom-unicode font as the top suggested font for unicode glyphs for all blocks"
|
|
|
|
(when doom-unicode-font
|
|
|
|
(let ((doom-unicode-font-family (plist-get (font-face-attributes doom-unicode-font) :family)))
|
|
|
|
(dolist (unicode-block unicode-fonts-block-font-mapping)
|
|
|
|
(push doom-unicode-font-family (cadr unicode-block))))))
|
|
|
|
|
2018-05-25 00:46:11 +02:00
|
|
|
;;;###autoload
|
2019-07-28 14:52:59 +02:00
|
|
|
(add-hook! 'doom-init-ui-hook
|
2019-07-22 04:46:14 +02:00
|
|
|
(defun +unicode-init-fonts-h ()
|
2019-12-01 22:31:19 -05:00
|
|
|
"Set up `unicode-fonts' to eventually run; accommodating the daemon, if
|
2018-05-25 00:46:11 +02:00
|
|
|
necessary."
|
2019-07-22 04:46:14 +02:00
|
|
|
(setq-default bidi-display-reordering t
|
|
|
|
doom-unicode-font nil)
|
2020-06-08 12:37:11 -04:00
|
|
|
(if (display-graphic-p)
|
2019-07-22 04:46:14 +02:00
|
|
|
(+unicode-setup-fonts-h (selected-frame))
|
|
|
|
(add-hook 'after-make-frame-functions #'+unicode-setup-fonts-h))))
|
2018-05-25 00:46:11 +02:00
|
|
|
|
|
|
|
;;;###autoload
|
2019-07-22 04:46:14 +02:00
|
|
|
(defun +unicode-setup-fonts-h (&optional frame)
|
2018-05-25 00:46:11 +02:00
|
|
|
"Initialize `unicode-fonts', if in a GUI session."
|
|
|
|
(when (and frame (display-graphic-p frame))
|
|
|
|
(with-selected-frame frame
|
|
|
|
(require 'unicode-fonts)
|
|
|
|
;; NOTE will impact startup time on first run
|
2020-06-12 12:45:37 -04:00
|
|
|
(+unicode--add-doom-unicode-font)
|
2018-05-25 00:46:11 +02:00
|
|
|
(unicode-fonts-setup))))
|