# Please enter the commit message for your changes.
[safanaj_home.git] / .emacs.d / my-faces.el
blobcefc14aa2c95cffd605b1ac8fd03edd97ad2ef15
1 ;; Font sizes
2 (defvar font-resizing-mode-map
3 (let ((m (make-sparse-keymap)))
4 (define-key m "+" 'increment-font-height)
5 (define-key m "-" 'decrement-font-height)
6 (define-key m "r" 'resize-font-height)
7 ; (define-key m "-" 'set-font-height)
8 (define-key m (kbd "C-c C-c") 'font-resizing-mode)
9 m))
11 (define-minor-mode font-resizing-mode
12 :init-value nil
13 :ligther " Font re-Size "
14 :keymap 'font-resizing-mode-map)
15 (put 'font-resizing-mode 'unit 8)
17 ;; (defun set-font-height (&optional n) "" (interactive "p")
18 ;; (set-face-attribute 'default (selected-frame)
19 ;; :height (+ (face-attribute 'default :height) n))
20 ;; (princ (format "Font height is %d." (face-attribute 'default :height))))
22 (defun resize-font-height (&optional n) "" (interactive "p")
23 (set-face-attribute 'default (selected-frame)
24 :height (+ (face-attribute 'default :height) n))
25 (princ (format "Font height is %d." (face-attribute 'default :height))))
27 (defsubst decrement-font-height ()""(interactive)
28 (resize-font-height (- (get 'font-resizing-mode 'unit))))
29 (defsubst increment-font-height ()""(interactive)
30 (resize-font-height (get 'font-resizing-mode 'unit)))
34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
35 (defun switch-inverted-color () "Switch Inverted Color Video."
36 (interactive) (message "Switch Inverted Color Video.")
37 (set-face-inverse-video-p 'default (not (face-inverse-video-p 'default))))
38 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39 ;(defvar my-color-style nil "Color Style")
40 (defun switch-color-style ()
41 " (interactive)
42 (if (eq style 'dark)
43 (prog1 (setq style nil)
44 (custom-set-faces
45 '(default ((t (:background \"white\" :foreground \"black\"))))))
46 (prog1 (setq style 'dark)
47 (custom-set-faces
48 '(default ((t (:background \"black\" :foreground \"white\"))))))))
50 (interactive) (message "Switch Color.")
51 (if (eq (get 'switch-color-style 'style) 'dark)
52 (prog1 (put 'switch-color-style 'style 'light)
53 (set-face-attribute 'default (selected-frame) :background "white" :foreground "black"))
54 (prog1 (put 'switch-color-style 'style 'dark)
55 (set-face-attribute 'default (selected-frame) :background "black" :foreground "white")))
56 (message "Switched Color to %s." (symbol-name (get 'switch-color-style 'style))))
58 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
59 (defun switch-font-style (&optional style) ""
60 (interactive)
61 (message "Switch Font Size.")
62 (if (null style) (setq style
63 (intern
64 (completing-read
65 "Font Style: "
66 (get 'switch-font-style 'avails)))))
67 (set-face-attribute 'default (selected-frame)
68 :height (get 'switch-font-style style))
69 (message "Switched Font Size to %s." style))
71 (put 'switch-font-style 'avails '((tiny) (smaller) (bigger) (huge)))
72 (put 'switch-font-style 'huge 182) ;; -5 x8
73 (put 'switch-font-style 'bigger 143) ;; -5 x8
74 (put 'switch-font-style 'smaller 103);; -3 x8
75 (put 'switch-font-style 'tiny 79) ;; x8
77 ;;;; Various Faces
78 (defface my-Corsivo-sottolineato-rosso
79 '((t (:family "LMSans17"
80 :underline t
81 :slant oblique
82 :underline t
83 :foreground "red"
84 :inherit default)))
86 :group 'my)
88 (defface my-Titolo-enorme
89 '((t (:family "LMSans9"
90 :height 4.0
91 :slant oblique
92 :weight bold
93 :inherit default)))
95 :group 'my)
97 ;; (defface my-face
98 ;; '((t
99 ;; ( :stipple nil
100 ;; :background "white"
101 ;; :foreground "black"
102 ;; :inverse-video nil
103 ;; :box nil
104 ;; :strike-through nil
105 ;; :overline nil
106 ;; :underline nil
107 ;; :slant normal
108 ;; :weight normal
109 ;; :height 87
110 ;; :width normal
111 ;; :family "b&h-lucida"))) "My Face")
113 ;;;;;;;;;;;;;;;; For Various & Hooks ;;;;;;;;;;;;;;;;
114 ;;;; For Term
115 (defun update-face-for-term () "" (interactive)
116 (custom-set-variables
117 '(term-default-bg-color (face-background 'default))
118 '(term-default-fg-color (face-foreground 'default))))
121 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
122 (provide 'my-faces)