如何在Ubuntu中的.emacs.el中设置默认字体(Inconsolata)?

时间:2010-10-18 10:42:05

标签: emacs fonts customization

我尝试遵循从Google搜索中收集的建议,但我无法让它发挥作用。我的~/.emacs.el文件包含以下内容:

;; Set color scheme
(require 'color-theme)
(load-file "/home/manoj/Dropbox/conf/themes/color-theme-chocolate-rain.el")
(color-theme-chocolate-rain)

;; Set font
;; (set-default-font "-unknown-Inconsolata-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")

;; Insert four spaces on tab
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)

我已经注释掉了字体配置行,因为它不起作用。我在2009-09-27上使用 GNU Emacs 23.1.50.1 (i486-pc-linux-gnu,GTK +版本2.18.0)在palmer上,由Debian在Ubuntu Karmic上修改。

1 个答案:

答案 0 :(得分:22)

从emacs版本判断,您似乎已经安装了emacs-snapshot(好)。

所以这应该有效:

sudo apt-get install ttf-inconsolata

然后输入类似

的〜/ .emacs文件
(set-frame-font "Inconsolata-12")

(12指的是字体大小,可以更改。)

相关问题