我还想在.emacs文件中保存字体大小。


当前回答

(set-face-attribute 'default nil :height 100)

这个值的单位是1/10pt,所以100会给你10pt,以此类推。

其他回答

如果你喜欢控制台emacs (emacs -nw),现代vterm实现(如gnome-terminal)往往有更好的字体支持。另外,如果您习惯了这一点,就可以使用tmux,这样即使没有X,也可以在远程服务器上使用完整的环境。

在NTEmacs 23.1中,选项菜单有一个“设置默认字体…”选项。

Firefox和其他程序允许您使用C-+和C——来增加和减少字体大小。我设置了我的.emacs,这样我就可以通过添加以下几行代码来拥有同样的能力:

(global-set-key [C-kp-add] 'text-scale-increase)

(global-set-key [C-kp-subtract] 'text-scale-decrease)
(set-face-attribute 'default nil :height 100)

这个值的单位是1/10pt,所以100会给你10pt,以此类推。

我有以下在我的。emacs:

(defun fontify-frame (frame)
  (set-frame-parameter frame 'font "Monospace-11"))

;; Fontify current frame
(fontify-frame nil)
;; Fontify any future frames
(push 'fontify-frame after-make-frame-functions) 

你可以用你选择的任何字体来代替“Monospace-11”。可用选项集高度依赖于系统。使用M-x set-default-font并查看制表符补全会给您一些启发。在我的系统上,在启用了Emacs 23和抗锯齿的情况下,可以根据名称选择系统字体,例如Monospace、Sans Serif等。