emacs设置字体

* C-h f set-default-font

 set-default-font is an alias for `set-frame-font' in `frame.el'.

(set-default-font FONT &optional KEEP-SIZE FRAMES)

This function is obsolete since 23.1;
use `set-frame-font' instead.

Set the default font to FONT.
When called interactively, prompt for the name of a font, and use
that font on the selected frame.  When called from Lisp, FONT
should be a font name (a string), a font object, font entity, or
font spec.

If KEEP-SIZE is nil, keep the number of frame lines and columns
fixed.  If KEEP-SIZE is non-nil (or with a prefix argument), try
to keep the current frame size fixed (in pixels) by adjusting the
number of lines and columns.

If FRAMES is nil, apply the font to the selected frame only.
If FRAMES is non-nil, it should be a list of frames to act upon,
or t meaning all graphical frames.  Also, if FRAME is non-nil,
alter the user's Customization settings as though the
font-related attributes of the `default' face had been "set in
this session", so that the font is applied to future frames.

* C-h f set-frame-font
set-frame-font is an interactive compiled Lisp function in `frame.el'.

(set-frame-font FONT &optional KEEP-SIZE FRAMES)

Set the default font to FONT.
When called interactively, prompt for the name of a font, and use
that font on the selected frame.  When called from Lisp, FONT
should be a font name (a string), a font object, font entity, or
font spec.

If KEEP-SIZE is nil, keep the number of frame lines and columns
fixed.  If KEEP-SIZE is non-nil (or with a prefix argument), try
to keep the current frame size fixed (in pixels) by adjusting the
number of lines and columns.

If FRAMES is nil, apply the font to the selected frame only.
If FRAMES is non-nil, it should be a list of frames to act upon,
or t meaning all graphical frames.  Also, if FRAME is non-nil,
alter the user's Customization settings as though the
font-related attributes of the `default' face had been "set in
this session", so that the font is applied to future frames.

* 使用的字体
字体的下载位置:

* 查看在emacs中字体的名字
使用 "M-x set-frame-font RET Tab Tab" 可以看到一个字体列表,从而确定字体的名字。
用鼠标点击 列表中的一行,就可以应用这个字体。

* .emacs设置
使用 set-default-font (23.1 以前版本),set-frame-font (23.1开始) 在 ~/.emacs 里添加:
 (set-frame-font "-microsoft-Mac雅黑-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1")

在行末用C-x C-e来运行即可,查看字体的效果


?怎么指定字体的大小
现在能用C-x C = 来增大字体

原文地址:https://www.cnblogs.com/vipzrx/p/3455840.html