equalsraf / neovim-qt

Neovim client library and GUI, in Qt5.
https://github.com/equalsraf/neovim-qt/wiki
ISC License
1.84k stars 172 forks source link

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

Open Boolean263 opened 2 years ago

Boolean263 commented 2 years ago

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):

Expected result:

Actual result:

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.)

jgehrig commented 2 years ago

@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 :)

madjxatw commented 1 year ago

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.