2

I have the following in my config:

  ;; set a non programming font for text
  (when (member "Lucida Sans Unicode" (font-family-list))
    (set-face-attribute 'variable-pitch nil :font "Lucida Sans Unicode"))

  ;; set a default font
  (when (member "Cascadia Code" (font-family-list))
    (set-face-attribute 'default nil :font "Cascadia Code")
    (set-face-attribute 'fixed-pitch nil :font "Cascadia Code"))

  ;; specify font for all unicode characters
  (when (member "DejaVu Sans Mono" (font-family-list))
    (set-fontset-font t 'unicode "DejaVu Sans Mono" nil 'prepend))

  (add-hook 'org-mode-hook 'variable-pitch-mode)

  (custom-theme-set-faces
   'user
   '(org-code ((t (:inherit (shadow fixed-pitch))))))

This gives me the following result: enter image description here

As you can see, under the header Fonts that is in the font Lucida Sans Unicode, there is a line

: ezaeaz

that is correctly displayed in Cascadia Code.

However, when I increase the font size with Ctrl + mouse wheel or by using C-x C-+, here is what happens: enter image description here

Org-mode being in variable pitch, the default font for the mode is Lucida Sans Unicode, which scaled up correctly. However the Cascadia Code font didn't, I assume because of the custom-theme-set-faces call that forces it to be something.

How can I make it so that both fonts are always the same size, or a ratio of one another?

Percee
  • 143
  • 6

1 Answers1

0

Have variable-pitch inherit the scaling face:

(when (member "Lucida Sans Unicode" (font-family-list))
  (set-face-attribute 'variable-pitch nil :font "Lucida Sans Unicode" :inherit t))
Mark
  • 81
  • 2
  • 1
    This doesn't change anything. The variable-pitch is scaling correctly, it's the default and fixed-pitch that aren't. I tried to add :inherit 'variable-pitch to both default and fixed-pitch to make they scale but it doesn't work either. – Percee Jul 09 '20 at 02:31