diff --git a/core/core-defuns.el b/core/core-defuns.el index fefe1028b..9ff55ad0a 100644 --- a/core/core-defuns.el +++ b/core/core-defuns.el @@ -284,5 +284,14 @@ Examples: (require 'autoloads)) (message "Done!"))) +(defun narf-fix-unicode (font chars &optional size) + "Display certain unicode characters in a specific font. + +e.g. (narf-fix-unicode \"DejaVu Sans\" '(?⚠ ?★ ?λ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓))" + (mapc (lambda (x) (set-fontset-font + "fontset-default" `(,x . ,x) + (font-spec :name font :size size) nil 'prepend)) + chars)) + (provide 'core-defuns) ;;; core-defuns.el ends here diff --git a/core/core-ui.el b/core/core-ui.el index 2d34ce1a0..eb49e9c78 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -74,15 +74,7 @@ (add-hook! 'after-init-hook (set-window-fringes (minibuffer-window) 0 0 nil))) ;; Try to display unicode characters without upsetting line-hieght (as much as possible) -(defun narf-fix-unicode (set) - (let ((font (car set)) - (chars (cadr set)) - (size (caddr set))) - (mapc (lambda (x) (set-fontset-font - "fontset-default" `(,x . ,x) - (font-spec :name font :size size) nil 'prepend)) - chars))) -(mapc 'narf-fix-unicode '(("DejaVu Sans" (?⚠ ?★ ?λ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓)))) +(narf-fix-unicode "DejaVu Sans" '(?⚠ ?★ ?λ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓)) ;; on by default in Emacs 25; I prefer to enable on a mode-by-mode basis, so disable it (when (and (> emacs-major-version 24) (featurep 'eldoc)) diff --git a/modules/module-org.el b/modules/module-org.el index 2e910d59b..3ca2c64eb 100644 --- a/modules/module-org.el +++ b/modules/module-org.el @@ -137,6 +137,12 @@ (file+headline (concat org-directory "topics/vocab.org") "Unsorted") "** %i%?\n"))) + (narf-fix-unicode "DejaVu Sans" '(?♭ ?♯)) + (narf-fix-unicode "Hack" '(?× ?∙ ?÷ ?⌉ ?⌈ ?⌊ ?⌋ + ?∩ ?∪ ?⊆ ?⊂ ?⊄ ?⊇ ?⊃ ?⊅ + ?⇒ ?⇐ ?⇔ ?↔ ?→ ?≡ ?∴ ?∵ ?⊕ ?∀ ?∃ ?∄ ?∈ ?∉ + ?∨ ?∧ ?¬)) + (org-babel-do-load-languages 'org-babel-load-languages '((python . t) (ruby . t) (sh . t) (js . t) (css . t)