请教下: macOS Emacs GUI 中文字体无法等宽对齐的问题

问题描述

不知道各位大佬有没遇到过类似问题,先看下图:

图中分别用 Emacs GUI,Emacs in Terminal, Vim in Terminal 打开同一个 Org 文件,终端和 Emacs GUI 的字体配置都是一样的,但是奇怪的是后两者在终端下 Org 表格中文都能对齐??

怀疑可能是字体不对,期间尝试了多种字体,如 Source Code Pro,Nerd Font,以及 @laishulu 大佬的 Sarasa-Mono-SC-Nerd,无论哪种字体都没法对齐中文。也尝试过配置 set default-fontface 也不起作用。

Versions

  • Emacs

$ brew install emacs-plus@27

GNU Emacs 27.1
Copyright (C) 2020 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
  • Doom version
Doom v2.0.9 (8bbac4bfb32aaf5b130c802a4ffb5d46fd1078eb)
Emacs v27.1
Branch: develop
Build date: 2020-08-08 03:06:26 -0400
  • macOS
ProductName:	Mac OS X
ProductVersion:	10.15.6
BuildVersion:	19G73

Emacs 传统艺能:对不齐

三种办法,最难的是自己调整中英文字体比例,简单点是换等宽字体比如更纱黑体,还有就是用 GitHub - casouri/valign: Pixel-perfect visual alignment for Org and Markdown tables.

1 个赞

试过设置成更纱黑体不行。。。

valign works!多谢指导。

装着两个字体就能对齐:

具体参考此处配置:

1 个赞