开发者

Setting emacs font under windows

开发者 https://www.devze.com 2023-02-19 15:09 出处:网络
I\'m having trouble to change the font for my emacs configuration. I\'ve tried using set-default-font, and managed to tab to my desired font, h开发者_JAVA百科owever, some elements are still rendered a

I'm having trouble to change the font for my emacs configuration. I've tried using set-default-font, and managed to tab to my desired font, h开发者_JAVA百科owever, some elements are still rendered as the old font (ie python's class names and function names)


set-default-font is really old, and has been deprecated in Emacs 23 in favor of its new name set-frame-font (which isn't much better). The current Emacs manual suggests several ways to set the default font, but I'll assume you've found those already, seeing as you've tried set-default-font...

The elisp code I use is actually different from all the methods suggested there:

;; [in .emacs]
;; Use 10-pt Consolas as default font
(set-face-attribute 'default nil
                    :family "Consolas" :height 100)

set-face-attribute seems to stick better than set-default-font; at least it seems to use Consolas consistently even in things like Python class and function names.


M-x customize-face default will let you customize the default font.

If some things are still rendered in a font you don't like, then position your cursor to be over the offending text and type M-x customize-face; the face that your cursor is over will be the default one to customize.

0

精彩评论

暂无评论...
验证码 换一张
取 消