How can I use multiple fonts in the modeline? For example, If want it to look like
Line: 23 Size: 3000
with Line
and Size
in a different font than the modeline
font, how should
(setq-default mode-line-format '(
"Line: %l Size: %i"
))
be modified?
Use propertize
. For example, to get Line:
and Size:
in bold as in your example:
(setq-default mode-line-format `(
,(propertize "Line:" 'face 'bold)
" %l "
,(propertize "Size:" 'face 'bold)
" %i"
))
You can use M-x list-faces-display
to see samples of defined faces, or define your own.
For future reference, you can take a look at the documentation for any variable you're trying to customize with C-h v
; the help for mode-line-format
mentions using propertize
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With