To change the font size (height) in Emacs, you have several methods depending on whether you want to do it temporarily, permanently, or via the GUI.
Temporarily Change Font Height (Zoom In/Out)
You can adjust the font size in the current Emacs session using built-in commands:
Increase font size (text-scale-increase): C-x C-+ (press Ctrl+x, then Ctrl+Shift+=) or
and then enter a number (positive to increase, negative to decrease).
M-x text-scale-increase
Decrease font size (text-scale-decrease): C-x C-- (press Ctrl+x, then Ctrl+-) or M-x text-scale-decrease
Reset font size to default: C-x C-0
This changes the font size only for the current buffer.
Permanently Change Font Height (Font Size) via Init File
If you want to set a specific font size every time Emacs starts, you can customize the font in your Emacs configuration file (~/.emacs or ~/.emacs.d/init.el).
Here’s an example to set the font size using the font spec or the simpler string font name syntax:
;; Set font with size 14
(set-face-attribute 'default nil :height 140)
The :height value is in 1/10 pt, so 140 means 14 pt.
Alternatively, set the font family and size explicitly:
(set-face-attribute 'default nil :font "DejaVu Sans Mono-14")
Replace "DejaVu Sans Mono" with your desired font family and 14 with your desired font size.
Changing Font via the M-x set-frame-font Command
You can also change the font at runtime via:
M-x set-frame-font RET DejaVu Sans Mono-14 RET
This will change the font for the current frame.
Summary
Temporary zoom: C-x C-+ / C-x C--
Permanent font size change: add (set-face-attribute 'default nil :height 140) to your init file
Change font at runtime: M-x set-frame-font
If you want me to provide instructions specific to your operating system or Emacs version, please let me know!