diff --git a/core/core-defuns.el b/core/core-defuns.el index 58748aef8..bda613001 100644 --- a/core/core-defuns.el +++ b/core/core-defuns.el @@ -322,13 +322,20 @@ Examples: (load "autoloads")) (message "Done!"))) -(defun doom-fix-unicode (font chars &optional size) +(defun doom-fix-unicode (font &rest chars) "Display certain unicode characters in a specific font. -e.g. (doom-fix-unicode \"DejaVu Sans\" '(?⚠ ?★ ?λ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓))" +e.g. (doom-fix-unicode \"DejaVu Sans\" ?⚠ ?★ ?λ)" + (declare (indent 1)) (mapc (lambda (x) (set-fontset-font t (cons x x) - (font-spec :name font :size size))) + (cond ((fontp font) + font) + ((listp font) + (font-spec :family (car font) :size (nth 1 font))) + ((stringp font) + (font-spec :family font)) + (t (error "FONT is an invalid type: %s" font))))) chars)) (defun doom-byte-compile (&optional minimal) diff --git a/core/core-editor.el b/core/core-editor.el index ce38d953c..433c42fed 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -343,7 +343,10 @@ "A-o" (kbd "ø") "A-O" (kbd "Ø") "A--" (kbd "–") - "A-_" (kbd "—")) + "A-_" (kbd "—") + "A-8" (kbd "•") + "A-*" (kbd "°") + "A-p" (kbd "π")) (provide 'core-editor) ;;; core-editor.el ends here diff --git a/core/core-ui.el b/core/core-ui.el index 5a21f538f..2f7e54474 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -65,9 +65,8 @@ (define-fringe-bitmap 'tilde [64 168 16] nil nil 'center) (set-fringe-bitmap-face 'tilde 'fringe) (setcdr (assq 'empty-line fringe-indicator-alist) 'tilde) - ;; Fix certain unicode characters without upsetting line-height - (doom-fix-unicode "DejaVu Sans Mono" '(?★) 13) - (doom-fix-unicode "Hack" '(?λ) 13)) + ;; Fallback to `doom-unicode-font' for Unicode characters + (set-fontset-font t 'unicode doom-unicode-font)) ;; Hide mode-line in help/compile window (add-hook 'help-mode-hook 'doom|hide-mode-line) @@ -192,6 +191,13 @@ (defface mode-line-buffer-file nil "Face for mode-line buffer file name") (defface mode-line-buffer-path nil "Face for mode-line buffer file path") + ;; Make certain unicode glyphs bigger for UI purposes + (doom-fix-unicode '("DejaVu Sans Mono" 15) ?✱) + (let ((font "DejaVu Sans Mono for Powerline")) + (doom-fix-unicode (list font 10) ?) + (doom-fix-unicode (list font 16) ?∄) + (doom-fix-unicode (list font 15) ?)) + ;; Custom modeline segments (spaceline-define-segment *buffer-path (concat @@ -217,13 +223,13 @@ buffer-path)))) (if active 'mode-line-buffer-path))) (powerline-raw "%b" (if active 'mode-line-buffer-file)) + " " (when buffer-file-name (powerline-raw - (concat (when buffer-file-name - (concat - (if (buffer-modified-p) " ✱") - (if (not (file-exists-p buffer-file-name)) "[!]"))) - (if buffer-read-only "[RO]")) + (concat + (if (not (file-exists-p buffer-file-name)) "∄" + (if (buffer-modified-p) "✱")) + (if buffer-read-only "")) 'mode-line-is-modified))) :tight-right t :skip-alternate t) @@ -248,7 +254,8 @@ "Version control info" (when vc-mode (propertize - (concat "⎇ " (substring vc-mode (+ 2 (length (symbol-name (vc-backend buffer-file-name)))))) + (concat " " + (substring vc-mode (+ 2 (length (symbol-name (vc-backend buffer-file-name)))))) 'face (when active (let ((state (vc-state buffer-file-name))) (cond ((memq state '(edited added)) @@ -378,11 +385,11 @@ anzu to be enabled." (let ((fe (doom/-flycheck-count 'error)) (fw (doom/-flycheck-count 'warning))) (concat - (if fe (propertize (format " ⚠%s " fe) + (if fe (propertize (format " •%s " fe) 'face (if active 'doom-flycheck-error 'mode-line))) - (if fw (propertize (format " ⚠%s " fw) + (if fw (propertize (format " •%s " fw) 'face (if active 'doom-flycheck-warning 'mode-line)))))))))) diff --git a/core/core-vars.el b/core/core-vars.el index cf4a72ed8..f84b73c69 100644 --- a/core/core-vars.el +++ b/core/core-vars.el @@ -42,5 +42,9 @@ gets killed.") "A list of files that count as 'project files', which determine whether a folder is the root of a project or not.") +(defvar doom-unicode-font + (font-spec :family "DejaVu Sans Mono" :size 13) + "Font to fall back to for unicode glyphs.") + (provide 'core-vars) ;;; core-vars.el ends here diff --git a/modules/module-org.el b/modules/module-org.el index 30c70ee5a..94502e8f6 100644 --- a/modules/module-org.el +++ b/modules/module-org.el @@ -152,12 +152,12 @@ )) ;; Display certain unicode characters properly - (doom-fix-unicode "DejaVu Sans" '(?⟳) 13) - (doom-fix-unicode "DejaVu Sans" '(?♭ ?♯)) - (doom-fix-unicode "Hack" '(?× ?∙ ?÷ ?⌉ ?⌈ ?⌊ ?⌋ - ?∩ ?∪ ?⊆ ?⊂ ?⊄ ?⊇ ?⊃ ?⊅ - ?⇒ ?⇐ ?⇔ ?↔ ?→ ?≡ ?∴ ?∵ ?⊕ ?∀ ?∃ ?∄ ?∈ ?∉ - ?∨ ?∧ ?¬)) + ;; (doom-fix-unicode '("DejaVu Sans" 13) + ;; ?♭ ?♯ ?⟳ + ;; ?× ?∙ ?÷ ?⌉ ?⌈ ?⌊ ?⌋ + ;; ?∩ ?∪ ?⊆ ?⊂ ?⊄ ?⊇ ?⊃ ?⊅ + ;; ?⇒ ?⇐ ?⇔ ?↔ ?→ ?≡ ?∴ ?∵ ?⊕ ?∀ ?∃ ?∄ ?∈ ?∉ + ;; ?∨ ?∧ ?¬) (org-babel-do-load-languages 'org-babel-load-languages