@@ -78,10 +78,10 @@ face names or script names expressed as keywords (with the \":\" prefix).
78
78
79
79
For example to set `default' face, use `:default' , to set the `mode-line' face,
80
80
use `:mode-line' , and so on. The parameters for each font in these cases (ie.
81
- for face names) are used in the `set-face-attribute ' function, so you can pass
82
- any key value pairs supported by `set-face-attribute ' (like `:weight' ,
83
- `:slanted ' , ...). A list of supported keywords are available in the variable
84
- `+set- face-attribute-keywords ' .
81
+ for face names) are used in the `custom-theme-set-faces ' function, so you can
82
+ pass any specs ( key value pairs) supported by `custom-theme-set-faces ' (like
83
+ `:weight ' , `:slant' , `:foreground' , ...). A list of supported keywords are
84
+ available in the variable `+ face-attributes ' .
85
85
86
86
You can also setup some language-specific fonts. All scripts supported by Emacs
87
87
can be found in `+known-scripts' . The keyword in this plist will be the script
@@ -109,10 +109,10 @@ scaling factor for the font in Emacs' `face-font-rescale-alist'. See the
109
109
" List of available fonts on the system, initialized at startup from
110
110
`font-family-list' ." )
111
111
112
- (defconst +set- face-attribute-keywords
112
+ (defconst +face-attributes
113
113
'(:family :foundry :width :height :weight :slant :foreground
114
- :background :underline :overline :strike-through :box
115
- :inverse-video :stipple :extend : font :inherit )
114
+ :distant-foreground : background :underline :overline :strike-through
115
+ :box : inverse-video :stipple :font :inherit :extend )
116
116
" Arguments accepted by the `set-face-attribute' function." )
117
117
118
118
(defconst +font-spec-keywords
@@ -129,7 +129,7 @@ scaling factor for the font in Emacs' `face-font-rescale-alist'. See the
129
129
(cl-intersection (+plist-keys font)
130
130
(if (memq script-or-face +known-scripts)
131
131
+font-spec-keywords
132
- +set- face-attribute-keywords ))))))
132
+ +face-attributes ))))))
133
133
134
134
(defun +font-installed-p (font-family)
135
135
" Check if FONT-FAMILY is installed on the system."
@@ -140,14 +140,17 @@ scaling factor for the font in Emacs' `face-font-rescale-alist'. See the
140
140
(catch 'done
141
141
(dolist (font (plist-get minemacs-fonts-plist (intern (format " :%s " script-or-face))))
142
142
(let* ((spec (+font--get-valid-args script-or-face font))
143
- (prepend (and (plistp font) (plist-get font :family )))
144
143
(scale (and (plistp font) (plist-get font :scale )))
145
- (family (plist-get spec :family )))
146
- (when (+font-installed-p family)
147
- (if (memq script-or-face +known-scripts)
148
- (set-fontset-font t script-or-face (apply #'font-spec spec) nil prepend)
149
- (apply #'set-face-attribute (append `(, script-or-face nil ) spec)))
150
- (when scale (add-to-list 'face-font-rescale-alist (cons (plist-get spec :family ) scale)))
144
+ (prependp (and (plistp font) (plist-get font :family )))
145
+ (family (plist-get spec :family ))
146
+ (scriptp (memq script-or-face +known-scripts)))
147
+ (when (or (not family) (+font-installed-p family))
148
+ (if scriptp
149
+ (set-fontset-font t script-or-face (apply #'font-spec spec) nil prependp)
150
+ (custom-theme-set-faces 'user `(, script-or-face ((t , spec )))))
151
+ (when (and scale family)
152
+ (add-to-list 'face-font-rescale-alist (cons family scale)))
153
+ (+log! " Settinng %s `%s' to `%s' " (if scriptp " script" " face" ) script-or-face spec)
151
154
(throw 'done spec))))))
152
155
153
156
; ; Inspired by: github.com/seagle0128/.emacs.d/blob/master/custom-example.el
@@ -162,7 +165,7 @@ scaling factor for the font in Emacs' `face-font-rescale-alist'. See the
162
165
; ; Run hooks
163
166
(run-hooks 'minemacs-after-setup-fonts-hook ))
164
167
165
- (make -obsolete #'+set-fonts #'+setup-fonts " v3.0.0" )
168
+ (define -obsolete-function-alias #'+set-fonts #'+setup-fonts " v3.0.0" )
166
169
167
170
(+add-hook! (window-setup server-after-make-frame) #'+setup-fonts )
168
171
0 commit comments