How do I change emacs default font size and font type?
Get current font by:
M-x describe-font
(Hit Enter
if you see Font name (default current choice for ASCII chars):
)
This will show a list of attributes which can be set in init.el
. After you've had a look the values, minimize the message buffer by C-x 1
.
Now do a M-x customize-face
and:
- Scroll down to the "Default" section
- Change the value of "Font Family"
- Change the value of "Height"
- Hit
Enter
on "State" and then 1 = Save for Future Sessions
Alternatively, in init.el
you could have something like:
(set-face-attribute 'default nil :font "Monospace" :height 160)
Note: If you have a preset for window size (width and height), the height
attribute of the font is going to interfere with that layout.
You can use the menu bar. Go to Options
->Set Default Font...
.
After you choose a font, don't forget to press Options
->Save Options
—otherwise your new font will not be saved after you close Emacs.
You can also do the following in your .emacs
file.
Emacs 23.1
(set-frame-font "Inconsolata 12" nil t)
Older versions of Emacs
(set-default-font "Inconsolata 12" nil t)