Emacs: Set Minibuffer Font Size

By Xah Lee. Date: .

emacs it seems, there's no easy way to change minibuffer font size. Really a pain, especially when you use Chinese input, where the choices of character in the minibuffer is too small to discern.

[see Emacs Chinese Input]

Here's some workarounds, all are hacks.

use face-remapping-alist

here's a solution from https://twitter.com/iLemming/status/973932170354950145

    (buf (list " *Minibuf-0*" " *Minibuf-1*" " *Echo Area 0*" " *Echo Area 1*" "*Quail Completions*"))
  (when (get-buffer buf)
    (with-current-buffer buf
      (setq-local face-remapping-alist '((default (:height 1.5)))))))

The solution above works, but is not flexible.

use minibuffer-setup-hook

here's another solution from https://stackoverflow.com/questions/7869429/altering-the-font-size-for-the-emacs-minibuffer-separately-from-default-emacs

(defun my-minibuffer-setup ()
       (set (make-local-variable 'face-remapping-alist)
          '((default :height 1.5))))

(add-hook 'minibuffer-setup-hook 'my-minibuffer-setup)

this does not work. that is, if you switch to Chinese input, the choices listed in minibuffer still has tiny font.

[see Emacs Chinese Input]

use minibuffer-prompt

here's another solution from https://emacs.stackexchange.com/questions/31393/how-do-i-change-the-color-of-the-prompt-in-the-mini-buffer

Alt+x customize-face then type minibuffer-prompt

In the face box, type Menlo-14. Then click apply and save. It'll add the following to your init:

 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(Info-quoted ((t (:foreground "red" :family "DejaVu Sans Mono"))))
 '(minibuffer-prompt ((t (:foreground "medium blue" :family "Menlo-15")))))

use set-frame-font

anoter solution, by Valentin Ignatyev at Emacs: Font Setup#comment-3803406989 is this:

(setq font-name "Hack" font-size 12)

(defun set-frame-font-size (&optional font-size)
  "Sets font size for all frames. Default is font-size"
  (interactive (list
        (read-number "number: " font-size)))
  (let ((font-size (or font-size font-size)))
    (set-frame-font (format "%s %d" font-name font-size) nil t)))


i haven't tried it.

Patreon me $5 patreon

Or Buy Xah Emacs Tutorial

Or buy a nice keyboard: Best Keyboard for Emacs

If you have a question, put $5 at patreon and message me.