syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.67k stars 4.89k forks source link

fixed-pitch face uses "Monospace" family #16171

Closed real-or-random closed 6 months ago

real-or-random commented 11 months ago

As most people, I use a fixed-pitch font (or a monospace font in common terms):

In my case, this is:

   dotspacemacs-default-font '("Iosevka Custom"
                               :size 15.0
                               :weight normal
                               :width normal)

Some packages rely on the fixed-pitch face, e.g., for code blocks, which should always be displayed in fixed-pitch. The fixed-pitch face uses the family "Monospace" by default (which is installed on my Linux system), and this default isn't changed in spacemacs (nor in the included themes):

           Family: Monospace
          Foundry: unspecified
            Width: unspecified
           Height: unspecified
           Weight: unspecified
            Slant: unspecified
       Foreground: unspecified
DistantForeground: unspecified
       Background: unspecified
        Underline: unspecified
         Overline: unspecified
   Strike-through: unspecified
              Box: unspecified
          Inverse: unspecified
          Stipple: unspecified
             Font: unspecified
          Fontset: unspecified
           Extend: unspecified
          Inherit: unspecified

This leads to an awkward mix of fonts in some cases: For example, in markdown-mode, code blocks will use a different font family than normal text, even though my default font is a fixed-pitch font, too.

image

I doubt that is desirable, but I also don't know what we could do about it. I, personally, can set this in my config, which will make fixed-pitch inherit from default.

  (set-face-attribute 'fixed-pitch nil :family 'unspecified)

The problem is that this applies only to people with a fixed-pitch font... But I believe this includes the vast majority of people, even when not on console. (Do we even "support" a variable-pitch font as dotspacemacs-default-font?) So you think we should set the above as default?

davidpiano commented 11 months ago

Is the font "Monospace" set as your operating system's default for fixed-width fonts? What happens if you change the system setting and re-start Emacs?

real-or-random commented 10 months ago

Is the font "Monospace" set as your operating system's default for fixed-width fonts?

No. "Monospace" is vanilla emacs's default for fixed-pitch as defined in faces.el.

real-or-random commented 10 months ago

Do we even "support" a variable-pitch font as dotspacemacs-default-font?

I checked what doom does, and they simply set the same font for default and fixed-pitch. https://github.com/doomemacs/doomemacs/blob/986398504d09e585c7d1a8d73a6394024fe6f164/lisp/doom-ui.el#L14-L23

I believe (set-face-attribute 'fixed-pitch nil :family 'unspecified) is a reasonable thing to do. Perhaps we could document that dotspacemacs-default-font should be a monospaced font.