【问题标题】:How can I set a default font (Inconsolata) in my .emacs.el in Ubuntu?如何在 Ubuntu 的 .emacs.el 中设置默认字体(Inconsolata)?
【发布时间】:2010-10-18 10:42:05
【问题描述】:

我尝试按照从 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)

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

【问题讨论】:

    标签: emacs fonts customization


    【解决方案1】:

    从 emacs 版本来看,您似乎已经安装了emacs-snapshot(很好)。

    所以这应该有效:

    sudo apt-get install ttf-inconsolata
    

    然后放入你的 ~/.emacs 文件中

    (set-frame-font "Inconsolata-12")
    

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

    【讨论】:

    • 快速说明:set-default-font 在 Emacs 24 上已过时。使用 set-frame-font ;-)
    • 命令“sudo apt-get install fonts-inconsolata”适用于 ubuntu 16.04
    猜你喜欢
    • 2020-12-13
    • 2015-02-13
    • 2012-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-04
    相关资源
    最近更新 更多