In emacs, I can change the font-size of current buffer by text-scale-adjust
. However, to change the font, I only find functions like set-face-font
or set-frame-font
, which will change the font globally in emacs (or change all buffers' font within current frame).
Is there a function in emacs that only changes the font (default font) of current buffer, while not modifying the fonts in any other buffers?
Note: this paragraph may be outdated :- After finishing the first startup process, press ESC -> SPACE -> f -> f -> . spacemacs . The font can be changed under dotspacemacs-default-font and layers can be enabled or disabled under dotspacemacs-configuration-layers among many other options.
By default, Emacs displays text on graphical displays using a 10-point monospace font, and the font size can be changed interactively (see Text Scale).
I found a way, though it has some side effects as it changes the global variable buffer-face-mode-face
For example, I want to set current buffer, I can eval this function definition and run it
(defun my-buffer-face-mode-serif ()
"Sets a fixed width (monospace) font in current buffer"
(interactive)
(setq buffer-face-mode-face '(:family "Times New Roman"))
(buffer-face-mode))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With