Skip to content
Snippets Groups Projects
Commit f1cd91af authored by Liu Miao's avatar Liu Miao
Browse files

move org font configurations to userconfig

parent 6bdfb831
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,9 @@ ...@@ -55,6 +55,9 @@
user/userconfig-file)) user/userconfig-file))
(load user/userconfig-file) (load user/userconfig-file)
;; Config before init
(user/config-before-init)
;; load `custom-file' ;; load `custom-file'
(setq custom-file user/custom-file) (setq custom-file user/custom-file)
(when (file-exists-p custom-file) (when (file-exists-p custom-file)
...@@ -114,6 +117,8 @@ ...@@ -114,6 +117,8 @@
(require 'init-org) (require 'init-org)
(require 'apps) (require 'apps)
;; Configurations after init
(user/config-after-init)
(provide 'init) (provide 'init)
;;; init.el ends here ;;; init.el ends here
...@@ -20,11 +20,6 @@ ...@@ -20,11 +20,6 @@
:weight normal :weight normal
:width normal)) :width normal))
(defvar user/org-default-font '("Noto Sans CJK SC"
:height 140
:weight normal
:width normal))
(defvar user/cache-directory (defvar user/cache-directory
(expand-file-name ".cache/" user-emacs-directory)) (expand-file-name ".cache/" user-emacs-directory))
......
...@@ -37,24 +37,6 @@ ...@@ -37,24 +37,6 @@
:commands (orgtbl-mode) :commands (orgtbl-mode)
:init :init
(defvar org-face-font nil) (defvar org-face-font nil)
(when (find-font (font-spec :name (car user/org-default-font)))
(let* ((font (car user/org-default-font))
(props (cdr user/org-default-font))
(fontspec (apply 'font-spec :name font props)))
(setq org-face-font fontspec)))
(when (fontp org-face-font)
(with-eval-after-load 'org
(add-hook 'org-mode-hook
(lambda ()
(make-face 'width-font-face)
(set-face-attribute 'width-font-face nil
:family (font-get org-face-font :family)
:height (font-get org-face-font :height)
:width (font-get org-face-font :width)) ;; 13, 14, 16等会出现不等宽
(setq buffer-face-mode-face 'width-font-face)
(buffer-face-mode)))))
:config :config
(require 'org-tempo) (require 'org-tempo)
......
...@@ -19,3 +19,18 @@ ...@@ -19,3 +19,18 @@
;; :width normal) ;; :width normal)
) )
;;; Custom configures
(defun user/config-after-init ()
(with-eval-after-load 'org
(add-hook 'org-mode-hook
#'(lambda ()
(make-face 'width-font-face)
(set-face-attribute 'width-font-face nil :font "Noto Sans Mono CJK SC 14")
(setq buffer-face-mode-face 'width-font-face)
(buffer-face-mode))))
;;
)
(defun user/config-before-init ()
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment