I also want to save the font size in my .emacs
file.
Firefox and other programs allow you to increase and decrease the font size with C-+ and C--. I set up my .emacs so that I have that same ability by adding these lines of code:
(global-set-key [C-kp-add] 'text-scale-increase)
(global-set-key [C-kp-subtract] 'text-scale-decrease)
From Emacswiki, GNU Emacs 23 has a built-in key combination:
C-xC-+ and C-xC-- to increase or decrease the buffer text size
I've got the following in my .emacs
:
(defun fontify-frame (frame)
(set-frame-parameter frame 'font "Monospace-11"))
;; Fontify current frame
(fontify-frame nil)
;; Fontify any future frames
(push 'fontify-frame after-make-frame-functions)
You can subsitute any font of your choosing for "Monospace-11"
. The set of available options is highly system-dependent. Using M-x set-default-font
and looking at the tab-completions will give you some ideas. On my system, with Emacs 23 and anti-aliasing enabled, can choose system fonts by name, e.g., Monospace
, Sans Serif
, etc.
Open emacs in X11, goto menu Options, select "set default font ...", change the font size. Select "save options" in the same menu. Done.
This is another simple solution. Works in 24 as well
(set-default-font "Monaco 14")
Short cuts:
`C-+` increases font size
`C--` Decreases font size
(set-face-attribute 'default nil :height 100)
The value is in 1/10pt, so 100 will give you 10pt, etc.