Open hmelman opened 6 years ago
Plain text in markdown-mode
just uses the default
face, but I think you can achieve what you want using buffer-face-mode
. There is some example code here: https://www.emacswiki.org/emacs/FacesPerBuffer
Kinda. So variable-pitch-mode
that I was using is based on buffer-face-mode
, and now I just learned about buffer-face-set
and this almost works:
(add-hook 'markdown-mode-hook '(lambda () (buffer-face-set '(:family "ETBembo"))))
Body text is shown in ETBembo, but headings aren't because markdown-header-face
inherits from variable-pitch
and font-lock-function-name-face
. I suspect there's more than just headers that do this but didn't look too far.
I know this issue is old but I came across it today and thought I'd add my $0.02.
I think you should first set "ETBembo" as your variable-pitch
font, then use buffer-face-set
to switch the default face to variable-pitch
:
(custom-set-faces
'(variable-pitch ((t (:family "ETBembo")))))
(buffer-face-set :inherit 'variable-pitch)
The other thing you might have to fight against is your theme. The theme I'm using completely resets all faces so the ones that I want to be fixed-pitch
are no longer so. Ultimately I gave up on this endeavor since a variable width font looked too weird to me.
If you really want to go down this road I recommend this article and video.
I just learned about ET Book font from this post on Ricing up Org Mode. Is there a way to configure just
markdown-mode
to use it? I currently use Arial as fontvariable-pitch
and enablevariable-pitch-mode
intext-mode-hook
andorg-mode-hook
. I'd like a way to keep that but just use ET Book (aka ETBembo) inmarkdown-mode
, is that possible? I didn't see a base font thatmarkdown-mode
used to render plain text. Could there be amarkdown-base-face
that all the non-monospace markdown fonts inherit from and that plain text used?