protesilaos / fontaine

Set Emacs font configurations using presets
https://protesilaos.com/emacs/fontaine
GNU General Public License v3.0
67 stars 1 forks source link

`variable-pitch-family nil` doesn't inherit `default-family`. Intentional? #11

Open Icy-Thought opened 1 month ago

Icy-Thought commented 1 month ago

Is the intended behavior of variable-pitch-family when set to nil to ignore the default-family value or is this an accidental issue that I happen to run across? I noticed that when I refrain from setting the values of neither fixed-pitch-family nor variable-pitch-family Emacs would fallback to my system "Sans" font instead of using the default-family value.

Fontaine snippet:

(use-package fontaine
  :demand t
  :config (fontaine-set-preset 'default)
  :custom
  (fontaine-presets
   `((default)
     (reading
      :variable-pitch-family "Cardo"
      :variable-pitch-height 185
      :variable-pitch-slant normal
      :variable-pitch-weight regular)
     (presentation
      :default-height 175
      :default-weight semibold)
     (t
      :default-family "VictorMono Nerd Font"
      :default-height 145
      :default-weight semibold
      :fixed-pitch-family "VictorMono Nerd Font"
      :fixed-pitch-height 145
      :fixed-pitch-slant normal
      :variable-pitch-family "VictorMono Nerd Font"
      :variable-pitch-height 1.00
      :variable-pitch-slant italic))))

Emacs Info:

protesilaos commented 1 month ago

From: Haruko @.***> Date: Sat, 19 Oct 2024 15:08:00 -0700

Is the intended behavior of variable-pitch-family when set to nil to ignore the default-family value or is this an accidental issue that I happen to run across?

It is intended to not try to do anything if we get a value that is not a string. In the function 'fontaine--set-face-attributes' we have the following:

(when (stringp family)
  (internal-set-lisp-face-attribute face :family family frames))

Has this caused a bug on your end?

-- Protesilaos Stavrou https://protesilaos.com

Icy-Thought commented 1 month ago

Oh interesting! I thought it would've picked the default-family instead of setting the value to nil.