Created
February 24, 2009 08:53
-
-
Save remvee/69476 to your computer and use it in GitHub Desktop.
font-zoom.el
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Font zooming with Hyper--/=/0 for Mac | |
| ;; Inspired by: http://www.emacswiki.org/cgi-bin/wiki/CycleFontSizes | |
| (defconst font-zoom-list | |
| (mapcar (lambda (n) (format "-*-monaco-*-*-*-*-%d-*-*-*-*-*-*-*" n)) '(6 8 10 13 17 18 24 36 48))) | |
| (defconst default-font-zoom-index 3) | |
| (defvar font-zoom-index default-font-zoom-index) | |
| (defun font-zoom-increase-font-size () | |
| (interactive) | |
| (progn | |
| (setq font-zoom-index (min (- (length font-zoom-list) 1) (+ font-zoom-index 1))) | |
| (set-frame-font (nth font-zoom-index font-zoom-list)))) | |
| (defun font-zoom-decrease-font-size () | |
| (interactive) | |
| (progn | |
| (setq font-zoom-index (max 0 (- font-zoom-index 1))) | |
| (set-frame-font (nth font-zoom-index font-zoom-list)))) | |
| (defun font-zoom-reset-font-size () | |
| (interactive) | |
| (progn | |
| (setq font-zoom-index default-font-zoom-index) | |
| (set-frame-font (nth font-zoom-index font-zoom-list)))) | |
| (define-key global-map (read-kbd-macro "H--") 'font-zoom-decrease-font-size) | |
| (define-key global-map (read-kbd-macro "H-=") 'font-zoom-increase-font-size) | |
| (define-key global-map (read-kbd-macro "H-0") 'font-zoom-reset-font-size) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment