seagle0128 / doom-modeline

A fancy and fast mode-line inspired by minimalism design.
https://seagle0128.github.io/doom-modeline/
GNU General Public License v3.0
1.29k stars 159 forks source link

[Bug] Icons on modeline lack sufficient padding #694

Closed judemille closed 8 months ago

judemille commented 8 months ago

Thank you for the bug report

Bug description

I am using doom-emacs, with Fira Code, 12pt. The major mode and checker icons do not have any padding to the right of them, which looks very bad.

Steps to reproduce

Install doom-emacs, enable icons in modeline

Expected behavior

Major mode and checker icons have spacing to the right of them.

OS

Linux

Emacs Version

29 (gccemacs)

Emacs Configurations

Doom Emacs

Error callstack

No response

Anything else

The issue can be seen here: image

This issue goes away if uses of doom-modeline-vspc in doom-modeline-segments.el are replaced with doom-modeline-spc.

It is unclear to me why the vspc is used anyway -- from all of my experience, the nerd-icons need a full-width space to gain sufficient padding.

seagle0128 commented 8 months ago

I think it's related to Fira Code and your nerd fonts. I am using "Cascadia Code" and "Symbol Nerd Fonts". What nerd fonts are you using?

vspc is a half-width space, and is used between a group of an icon and texts. The screenshot is below

image

My suggestion is:

  1. Try emacs -Q with doom-modeline and your font configurations.
  2. Try other fonts, including default font and nerd font.
judemille commented 8 months ago

I'm using Fira Code. I have :ui unicode enabled in Doom, and Symbols Nerd Font installed and enabled.

The issue occurs with Cascadia Code and JetBrains Mono, too.

judemille commented 8 months ago

Here is the appearance with emacs -Q: image

I added MELPA, installed doom-modeline, set the font to FiraCode Nerd Font, and enabled doom-modeline-mode. The gaps between the icons and the text are still uncomfortably small.

seagle0128 commented 8 months ago

I tested on macOS, Windows and Ubuntu, and no issues were observed. I think it may be related to your WM?

judemille commented 8 months ago

I'm running Arch Linux rolling, with KDE 5.27.10.

The issue exists on my laptop too, also Arch, with sway (have not checked version)

seagle0128 commented 8 months ago

Well, I didn't test with KDE. I'm sure there is no issue with GTK, according to my tests.

judemille commented 8 months ago

On my laptop, I'm using the emacs-wayland package, which has PGTK enabled. I don't think this is toolkit-specific.

Out of curiosity, how does it look for you if you change all vspc occurrences to just spc?

seagle0128 commented 8 months ago

No idea why vspc is so narrow in your env. Can you please try this?

(defsubst doom-modeline-vspc ()
  "Thin whitespace."
  (propertize " " 'face 'variable-pitch))

image

judemille commented 8 months ago

Changing that did nothing. Replacing all occurrences of doom-modeline-vspc with doom-modeline-spc does this: image

I have no clue why changing what vspc is doesn't do anything, but not using it does.

seagle0128 commented 8 months ago

Re-evaluate doom-modeline-segment.el or compile doom-modeline-core.el and restart Emacs after changing.

image

Are you sure the both are spc?

Try:

(defsubst doom-modeline-vspc ()
  "Thin whitespace."
  (propertize " " 'face 'variable-pitch))
judemille commented 8 months ago

Both are spc, yes. This is known behavior of nerd-icons -- if you put a space after an icon, it will become wider into that space, but still leaving a slight space.

seagle0128 commented 8 months ago

Both are spc, yes. This is known behavior of nerd-icons -- if you put a space after an icon, it will become wider into that space, but still leaving a slight space.

Obviously the behavior is different in my env.

vspc=spc image

vspc=1/2 spc image

judemille commented 8 months ago

That's fascinating. The only possibly explanation I can come up with is that something about the fontconfig on Arch is different from your Ubuntu install.

judemille commented 8 months ago

I've just realized what's going on. It's Symbols Nerd Font vs Symbols Nerd Font Mono.

I didn't have the mono variant installed. Going to install it and see the behavior.

E: That was indeed it. Might be worth a note somewhere in the FAQ or something, to remind people that they should have the mono variant of Symbols Nerd Font installed.