UP | HOME

emacs-设置中英文等宽

[2024-04-29 周一 19:26]

https://emacs-china.org/t/topic/27133

从楼主提供的第三个方案中学到了,可以通过设置默认行高属性避免中英文字体等宽混搭时的行高抖动。

(set-font "Cascadia Code" "HarmonyOS Sans SC" 28 32)
(setq default-text-properties '(line-spacing 0.06 line-height 1.15))
;;通过设置行高属性的方式避免英文行输入中文后的行高抖动

不过我还是坚持使用同等字号的中英文混搭,因为主要用Org-mode,平常需要等宽的地方很少,只需设置 org-tablefaces 为中英文等宽字体就好了:

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(org-archived ((t (:foreground "#928374" :weight regular))))
 '(org-table ((t (:background "#ebdbb2" :family "Sarasa Term SC")))))

▲ 编辑于 [2024-08-22 周四 11:09] | © Published by Emacs 30.0.50 (Org mode 9.7.10) on [2024-08-22 周四 11:25] | RSS