> Note: when you use the "change buffer font" menu, the font selected doesn't affect the frame. Examine the buffer-face-mode-remapping variable for that using C-h v buffer-face-mode-remapping. -- Yamitai
Use the menu:
This saves the font to .emacs.
Or add it to .emacs directly:
(set-face-attribute 'default nil :font "Andale Mono-12")
Lisp:frame-restore.el will save/restore the font you’ve selected through the mouse-set-font menu. this means you never have to know the “X format” name. very handy if you change the font often.
The problem is that you need to use the X format of specifying a font. Here’s how to do it (works with recent versions of Gnu-Emacs (Oct.2007)):
(w32-select-font)followed by C-j (or M-x
"-outline-Lucida Sans Typewriter-normal-r-normal-normal-12-90-96-96-c-*-iso8859-1") and paste it into the .emacs file (MsWindowsDotEmacs) or the registry (MsWindowsRegistry). If .emacs is used the line to add is:
(set-face-font 'default "fontname
")where fontname is the copied string
(these are earlier guidelines on this page)
From: Michael Slass <email@example.com> Subject: Re: How to make selected font permanent? Newsgroups: gnu.emacs.help Date: Tue, 23 Oct 2001 19:22:39 GMT
The next time you start emacs, you’ll have the font you want.
Even simpler is just to evaluate (press
C-x C-e at the end of the line):
(insert (prin1-to-string (w32-select-font)))
It will show you a dialog, from which you can choose font, and insert its name at the current point.
With Emacs >= 21.x you can do it like: (set-face-font ‘default “-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-15”) in your .emacs
Sorry, but this does not work for me using GNU Emacs 21.2 on Windows XP. I can only see this:
((display . “”) (visibility . t) (icon-name) (window-id . “917794”) (top . 0) (left . 0) (buffer-list #<buffer scratch> #<buffer NEWS>
but not any kind of font information. Any hints?
Note: when you use the “change buffer font” menu, the font selected doesn’t affect the frame. Examine the buffer-face-mode-remapping variable for that using C-h v buffer-face-mode-remapping. – Yamitai
If you would like emacs to start with a specific font, instead of jumping around as it resizes, you can put your font configuration in the MsWindowsRegistry (and frame size):
[HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs] "Emacs.FONT"="-*-Lucida Console-normal-r-*-*-11-82-96-96-c-*-iso8859-1" "Emacs.GEOMETRY"="90x60"
But how about fontset? Is there any way to define fontset even before emacs starts? – JoonhwanLee