Skip to content

Commit

Permalink
Apply font to fixed-pitch face as well
Browse files Browse the repository at this point in the history
and document this properly.
Fixes #16171
  • Loading branch information
smile13241324 committed Mar 29, 2024
1 parent 7f53fe5 commit d519cec
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
7 changes: 5 additions & 2 deletions core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,11 @@ pressing `<leader> m`. Set it to `nil` to disable it."
:size 10.0
:weight normal
:width normal)
"Default font, or prioritized list of fonts. This setting has no effect when
running Emacs in terminal."
"Default font or prioritized list of fonts. This setting has no effect when
running Emacs in terminal. The font set here will be used for default and
fixed-pitch faces. The `:size' can be specified as
a non-negative integer (pixel size), or a floating-point (point size).
Point size is recommended, because it's device independent. (default 10.0)"
'(choice (cons string sexp)
(repeat (cons string sexp)))
'spacemacs-dotspacemacs-init)
Expand Down
6 changes: 5 additions & 1 deletion core/core-fonts-support.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ The return value is nil if no font was found, truthy otherwise."
;; that the font is applied to future frames is to modify
;; default-frame-alist, and Customization causes issues, see
;; https://github.com/syl20bnr/spacemacs/issues/5353.
;; INHIBIT-CUSTOMIZE is only present in recent emacs versions.
;; INHIBIT-CUSTOMIZE is only present in recent emacs versions.
(if (version< emacs-version "28.0.90")
(set-frame-font fontspec nil t)
(set-frame-font fontspec nil t t))
(push `(font . ,(frame-parameter nil 'font)) default-frame-alist)

;; Make sure that our font is used for fixed-pitch face as well
(set-face-attribute 'fixed-pitch nil :family 'unspecified)

;; fallback font for unicode characters used in spacemacs
(pcase system-type
(`gnu/linux
Expand Down
4 changes: 3 additions & 1 deletion core/templates/.spacemacs.template
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ It should only modify the values of Spacemacs settings."
;; (default t)
dotspacemacs-colorize-cursor-according-to-state t

;; Default font or prioritized list of fonts. The `:size' can be specified as
;; Default font or prioritized list of fonts. This setting has no effect when
;; running Emacs in terminal. The font set here will be used for default and
;; fixed-pitch faces. The `:size' can be specified as
;; a non-negative integer (pixel size), or a floating-point (point size).
;; Point size is recommended, because it's device independent. (default 10.0)
dotspacemacs-default-font '("Source Code Pro"
Expand Down
3 changes: 2 additions & 1 deletion doc/DOCUMENTATION.org
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,8 @@ The default font used by Spacemacs is [[https://github.com/adobe-fonts/source-co
recommended to install it on your system if you wish to use it.

To change the default font set the variable =dotspacemacs-default-font= in your
=.spacemacs= file. By default its value is:
=.spacemacs= file, this setting will be used for the =default= and =fixed-pitch= faces.
By default its value is:

#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-default-font '("Source Code Pro"
Expand Down

0 comments on commit d519cec

Please sign in to comment.