10.27.07

Change emacs font permanently

Posted in Programming, emacs, linux, 리눅스, 프로그래밍 at 5:13 am by KJ

From CSE HUJI Emacs Fonts HOWTOTo check if some font is available in emacs do following:

1. Switch to *scratch* buffer.
2. Type: (prin1-to-string (x-list-fonts “font-you-whant-to-check or pattern”)).
3. Place the cursor after the last closing paren and hit C-j. List of the names of available fonts matching given pattern will appear in the current buffer (*scratch*).
4. For listing of all available fonts use (prin1-to-string (x-list-fonts “*”)).

Pick one that you want to use and add or edit a line in ~/.Xdefaults

Emacs.font: font-name

These steps are not enough to make a new font in effect. Do the followings.

From How can I change the font for emacs in ubuntu 7.10

Edit~/ .Xdefaults
$ xrdb -merge ~/.Xdefaults

A better way is found.

From Permanent Font Change (~/.emacs)

Add in ~/.emacs :

(setq default-frame-alist '((font . "-font-name-from-xfontsel")))

Leave a Comment