2

I've learned here that I can customize my variable-pitch font. For org-mode, I'm using that customization together with the following snippet to get a mix of variable and fixed-pitch fonts:

(add-hook 'org-mode-hook
            '(lambda ()
               (variable-pitch-mode 1)
               (mapc
                (lambda (face)
                  (set-face-attribute face nil :inherit 'fixed-pitch))
                (list 'org-code
                      'org-link 
                      'org-block
                      'org-table
                      'org-block-begin-line
                      'org-block-end-line
                      'org-meta-line
                      'org-document-info-keyword))))

Everything except for normal text is displayed in fixed-pitch, which is displayed with variable-pitch. The problem with my solution is that the font-size for both fonts is different and the variable-pitch looks really small and hard to read. How can I adapt my solution so that both fonts have the same size?

(I also have the feeling that my solution is not ideal because I get buffer fontification problems every now and then in SRC blocks when opening files..)

Example image:

different-fonts

1 Answer 1

2

This may or may not be what you are asking for, but if you set the :height property (i.e. font size) on default to some integral size, then you set the :height property on variable-pitch to a fractional value and it will be interpreted as a scaling factor applied on the parent face.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.