fixed-pitch-mode icon indicating copy to clipboard operation
fixed-pitch-mode copied to clipboard

Do I need to enable variable-pitch-mode?

Open oatmealm opened this issue 1 year ago • 3 comments

Slightly confused. Don't I also need to enable variable-pitch-mode to actually have the propotional fonts used? I don't see in the code that it's enabled anywhere...

oatmealm avatar Feb 19 '23 08:02 oatmealm

@oatmealm Looks like you set the default (font or frame, etc.) as variable pitch, and then set fixed-pitch-mode where or when you don't want that default.

jeff-phil avatar Jan 20 '24 07:01 jeff-phil

@oatmealm No, to have proportional fonts (and enable this package) all you need to do is set variable font (as your default font) in your init.el : (setq-default default-frame-alist '((font . "Helvetica-12")))

Then if you want to style how your proportional font will look like (and also mono font) you can use faces:

(custom-set-faces '(fixed-pitch ((t (:family "Monego" :height 105))))
                  '(variable-pitch ((t (:family "Crimson Pro" :height 140)))))

Majority of buffers will use your variable font, some (already specified by this package) will use your mono font, if you want to specifiy more buffers which must use your mono font use white list feature:

(setq fixed-pitch-whitelist-hooks
	'(cider-mode-hook
	  cider-docview-mode-hook
	  cider-popup-buffer-mode
	  cider-test-report-mode-hook
	  cider-repl-mode-hook))

If you want to switch fast (temporary) in some buffer do M-x fixed pitched mode

gety9 avatar Jan 26 '24 00:01 gety9

@oatmealm Does the explanation from @gety9 help? They are absolutely right about how this package functions. You only need to load the package and then (optionally) add hooks for modes were you want to use a monospaced font.

cstby avatar Feb 08 '24 02:02 cstby