neovim-qt icon indicating copy to clipboard operation
neovim-qt copied to clipboard

`set guifont` isn't treated as a comma-separated list

Open Boolean263 opened this issue 2 years ago • 2 comments

From :help 'guifont':

This is a list of fonts which will be used for the GUI version of Vim.
In its simplest form the value is just one font name.  When
the font cannot be found you will get an error message.  To try other
font names a list can be specified, font names separated with commas.
The first valid font is used.

Test case (tested on Ubuntu 22.04, with NVIM-QT v0.2.16.0 installed via apt, and with v0.2.17.0 built from source):

  • set guifont=Nonexistent\ 10,Monospace\ Regular\ 10

Expected result:

  • Font gets set to Monospace Regular 10, since there's no font installed named 'Nonexistent'

Actual result:

  • Error message: Unknown font: Nonexistent 10,Monospace Regular 10

I use this feature to have a portable config file across systems which may not have my first choice of font installed. It's also handy across platforms which use different syntax for their font specifications.

The feature works as expected in Neovide 0.9.0, as well as gVim for Windows 8.2.2825. (Strangely, as I prepared this issue report, I found that gVim 8.2.3995 on my Ubuntu system gives differently wrong behaviour, but I know it's worked in the past.)

Boolean263 avatar Jul 06 '22 14:07 Boolean263

@Boolean263

Thanks for the bug report!

I was not aware of the existence of this feature. From some quick testing, I see the same: gVim behaves as you describe. We already support a comma separated list for guifontwide and I don't see any reason this cannot be supported by GuiFont and guifont in neovim-qt.

I'll add this to my list of work :)

jgehrig avatar Sep 24 '22 15:09 jgehrig

Any progress about this issue? I encountered the similar issue on Windows when supplying a comma separated list of fonts as fallbacks. E.g. with set guifont=JetBrains_Mono:h10,\ Symbols_Nerd_Font_Mono:h10, nvim-qt reports Invalid font height at startup. The GuiFont command does not work either. It seems that the text following the comma is taken as the part of the height.

madjxatw avatar Sep 02 '23 11:09 madjxatw