[英]Emacs : "set default font" and init.el
我想設置我的起始默認字體。 我在選項 --> 設置默認字體中選擇一種字體。 然后我用選項 --> 保存選項保存它。
這寫在我的 ~/.emacs.d/init.el 文件的末尾:
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant italic :weight bold :height 241 :width normal :foundry "microsoft" :family "Trebuchet MS" "Courier New" :foundry "monotype" :slant normal :weight bold :height 240 :width normal "Courier New"))))
再次啟動 emacs 時,未加載所選字體。 init.d 文件沒有問題,如*Messages*
或 --debug-init 中所述。 似乎“設置默認字體”查找字體和 init.d 查找字體的機制不同......
我做錯了什么?
在 Ubuntu 14.04LTS、Emacs 24 上運行
您可以在 init.el 文件中設置以下內容:
(設置默認字體“Inconsolata 12”)
或摩納哥字體
(設置默認字體“摩納哥 12”)
這對我有用(Emacs 27.1)
;; Set default font
(set-face-attribute 'default nil
:family "Courier New"
:height 120
:weight 'normal
:width 'normal)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.