From cabdfd8cb771cdf0801c6bb7182bf47add644872 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 6 Jan 2024 20:42:48 +0800 Subject: [PATCH] feat: emacs - cjk fonts --- .../base/desktop/editors/emacs/doom/config.el | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/home/base/desktop/editors/emacs/doom/config.el b/home/base/desktop/editors/emacs/doom/config.el index 68614271..6119b224 100644 --- a/home/base/desktop/editors/emacs/doom/config.el +++ b/home/base/desktop/editors/emacs/doom/config.el @@ -21,11 +21,20 @@ ;; See 'C-h v doom-font' for documentation and more examples of what they ;; accept. For example: ;; -(setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size 17 :weight 'light) - doom-variable-pitch-font (font-spec :family "DejaVu Sans" :size 18) - doom-symbol-font (font-spec :family "JuliaMono") +(setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size 18 :weight 'normal) + doom-variable-pitch-font (font-spec :family "DejaVu Sans") + doom-symbol-font (font-spec :family "Symbols Nerd Font Mono") doom-big-font (font-spec :family "JetBrainsMono Nerd Font" :size 28)) -;; + +;; Users should inject their own font logic in `after-setting-font-hook' +;; Add font for CJK charset +(defun init-cjk-fonts() + (dolist (charset '(kana han cjk-misc bopomofo)) + (set-fontset-font (frame-parameter nil 'font) + charset (font-spec :family "Source Han Sans SC")))) +(add-hook 'after-setting-font-hook 'init-cjk-fonts) + + ;; If you or Emacs can't find your font, use 'M-x describe-font' to look them ;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to ;; refresh your font settings. If Emacs still can't find your font, it likely @@ -76,14 +85,6 @@ ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how ;; they are implemented. -(use-package! nerd-icons) -;; :custom -;; The Nerd Font you want to use in GUI -;; "Symbols Nerd Font Mono" is the default and is recommended -;; but you can use any other Nerd Font if you want -;; (nerd-icons-font-family "Symbols Nerd Font Mono") - - (use-package! lsp-bridge :config (setq lsp-bridge-enable-log nil)