-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfont-height.el
More file actions
33 lines (26 loc) · 935 Bytes
/
font-height.el
File metadata and controls
33 lines (26 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
;;; font-height.el --- scale font height for entire frame, including mode-line
;; Version: 0
(defun font-height-adjust (factor)
"Adjust default font height for current frame by scaling factor."
(let* ((cur (face-attribute 'default :height))
(new (* factor cur))
(rnd (* 10 (round new 10)))) ;round to nearest 10
(set-face-attribute 'default (selected-frame) :height rnd)
(message "font height %d -> %d" cur rnd)
(run-with-timer 3 nil (lambda () (message nil)))))
;;;###autoload
(defun font-height-increase ()
"Increase font height."
(interactive)
(font-height-adjust 1.1))
;;;###autoload
(defun font-height-decrease ()
"Decrease font height."
(interactive)
(font-height-adjust 0.9))
(defun font-height-reset ()
"Reset font height to value configured at startup."
(interactive)
(set-face-font 'default "fontset-startup"))
(provide 'font-height)
;;; font-height.el ends here