我想在Emacs中使用Proggy字体进行编程。如何设置?
请注意,它是一种位图字体。
请注意,它是一种位图字体。
您可以使用以下方法:
(set-default-font "ProggyClean")
这个已经被废弃了,应该使用其他替代方法。
(set-frame-font "ProggyClean")
.emacs
文件中设置,或者您可以执行M-x: customize-face: default
命令,并将ProggyClean
设置为“字体族”。只是将 set-default-font 放在您的 .emacs 文件中并不能跨多个框架工作 - 每个新框架都会回到旧的默认值。自定义选项确实可以在多个框架中使用,但我从未成功地使其在不同平台上正常工作(即使对于相同的字体,不同平台也具有不同的字体设置)。
所以!这是我在我的 .emacs 文件中得到的内容。它适用于 Linux、Win32 和 Cygwin,并且适用于多个框架(因此适用于 Emacs 客户端)。
(defconst win32p (eq system-type 'windows-nt) "Are we running on a Windows system?")
(defconst cygwinp (eq system-type 'cygwin) "Are we running on Cygwin?")
(defconst linuxp (or (eq system-type 'gnu/linux) (eq system-type 'linux)) "Are we running on Linux?")
;;font setups
(defvar vsc-little-font "" "*My lovely little font")
(when linuxp
(setq vsc-little-font "ProggyTinyTT-8"))
(when cygwinp
(setq vsc-little-font "ProggyTinyTT-16"))
(when win32p
(setq vsc-little-font "-outline-ProggyTinyTT-normal-r-normal-normal-16-120-96-96-c-*-iso8859-1"))
(add-to-list 'default-frame-alist (cons 'font vsc-little-font))
(add-to-list 'initial-frame-alist (cons 'font vsc-little-font))