-
Notifications
You must be signed in to change notification settings - Fork 0
/
zh.el
31 lines (28 loc) · 1.01 KB
/
zh.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;;; pyim
(use-package pyim
:straight t
:config
(setq default-input-method "pyim"))
;;; pyim-basedict
(use-package pyim-basedict
:straight t
:config
(pyim-basedict-enable))
;; Set Chinese font.
(defun get-han-font ()
"Return the name of an available Chinese font based on the current operating system."
(pcase system-type
('windows-nt
(or (car (seq-filter (lambda (font) (member font (font-family-list)))
'("Microsoft YaHei" "Microsoft JhengHei" "SimHei")))
"default-windows-font"))
('darwin
(or (car (seq-filter (lambda (font) (member font (font-family-list)))
'("Hei" "Heiti SC" "Heiti TC")))
"default-mac-font"))
('gnu/linux
(or (car (seq-filter (lambda (font) (member font (font-family-list)))
'("WenQuanYi Micro Hei")))
"default-linux-font"))))
(unless (string-equal (face-attribute 'default :family) "JetBrains Mono")
(set-fontset-font "fontset-default" 'han (get-han-font)))