/
init-font.el
41 lines (27 loc) · 1.36 KB
/
init-font.el
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
34
35
36
37
38
39
40
41
; https://www.reddit.com/r/emacs/comments/3ngatv/setting_the_default_font_for_a_frame/
(setq my-font-size "18")
(setq my-font-family-mac "Courier New")
(setq my-font-family-mac "PT Mono")
(setq my-font-family-win "Consolas")
(setq my-font-family-cygwin "Lucida Sans Typewriter")
(setq my-font-win (concat my-font-family-win)) ; "-" my-font-size))
(setq my-font-mac (concat my-font-family-mac "-" my-font-size))
(cond
((string-equal system-type "windows-nt") ; Microsoft Windows
(when (member "DejaVu Sans Mono" (font-family-list))
(add-to-list 'initial-frame-alist (list 'font my-font-win)
(add-to-list 'default-frame-alist (list 'font my-font-win)))))
((string-equal system-type "cygwin") ;
(when (member my-font-family-cygwin (font-family-list))
(add-to-list 'initial-frame-alist (list 'font my-font-family-cygwin)
(add-to-list 'default-frame-alist (list 'font my-font-family-cygwin)))))
((string-equal system-type "darwin") ; Mac OS X
(set-frame-font my-font-mac))
((string-equal system-type "gnu/linux") ; linux
(when (member "DejaVu Sans Mono" (font-family-list))
(add-to-list 'initial-frame-alist (list 'font "DejaVu Sans Mono-10"))
(add-to-list 'default-frame-alist (list 'font "DejaVu Sans Mono-10")))))
; (text-scale-normal-size)
(text-scale-increase 1) ; 2 steps larger
(text-scale-decrease 1) ; 2 steps larger
(provide 'init-font)