Can't size doom-variable-pitch-font

What happened?

Changing the variable pitch font size doesn’t do any difference.

(setq doom-font (font-spec :family "Fira Code" :size 12)
      doom-big-font (font-spec :family "Fira Code" :size 18)
      doom-variable-pitch-font (font-spec :family "Open Sans" :size 12))

When I change the font family and go into Writeroom (SPC t z) I can see that the font changes but never the size, no matter what value I put in. I have read multiple configs online and they seem to be able to use size. I have the same behaviour on laptops with Fedora 40 and Debian 11/12. I’m not sure it’s a bug or something I’m still missing?

What did you expect to happen?

Setting size 12 or size 32 would make a visible difference in the size of the font when using Writeroom (SPC t z).

Steps to reproduce

  1. Set or change doom-variable-pitch-font size.
  2. Go into Writeroom (SPC t z)
  3. Font size is the same no matter what number is in the config.el.

System information

Loading data dump...
1 Like

I’ve just notice the same thing on MacOS. I tried using height instead of size and it did the same thing.

(setq doom-font (font-spec :name "Iosevka Comfy" :size 16 :width 'wide)
      doom-variable-pitch-font (font-spec :name "Iosevka Etoile" :height 500 :weight 'regular)
      doom-serif-font (font-spec :name "Iosevka Etoile" :size 16 :weight 'regular)

I found the fix. Check out this post on Stackexchange.

In your (after! mixed-pitch block, include:

  (setq mixed-pitch-set-height t)
  (setq variable-pitch-serif-font doom-variable-pitch-font)
  (set-face-attribute 'variable-pitch nil :height 0.9)

the height is the proportion of the basic doom-font. To confirm it worked, I used a height of 1.7 and it was huge. To scale it down, go with a number less than one.