Open Warpulis opened 6 years ago
Given the resolution dependent behaviour I would suspect something strange is going on with the font metrics returned by Qt.
Is any of the screens using HiDpi? We have some issues pending with that https://github.com/equalsraf/neovim-qt/issues/391#issuecomment-363394722
My guess would be that there is not enough space for the bold glyphs to be rendered properly in "non bold mode"
If this were the case then the font is reporting incorrect metrics, or is missing a bold variant and is behind replaced by some other font at runtime. It is also possible the font does not really provide those sizes (but h12 should be pretty common). And neovim-qt reports those cases as errors when you call Guifont https://github.com/equalsraf/neovim-qt/blob/2cd39097caf9e9a44e1d79788e01b2e9f667aa59/src/gui/shellwidget/shellwidget.cpp#L60
We can test this to some extent. Does it help to increase the linespace? using :Guilinespace 2
or some other value might get you the space you need.
If you are building from the source there is a fontinfo executable target that can print font metric information for you.
resolution at work is 1920x1200.
I'm questioning my mind, since today I didn't have the half-width underscores as claimed in the original post. instead I'm also seeing the jump from no underscores to "full" underscores with h12
-> h13
.
I'm trying to reproduce the half underscores issue, but I'm not aware of anything I changed with the settings. (except from logging in remote.)
Unfortunately, :Guilinespace 2
didn't affect the issue.
I'm using the version from nvim 0.3.0, not building from source. It would be nice to have the debug infos I saw within isBadMonospace
. Not sure if I'm able to build from source since I don't have a Windows installation at home.
I'm using a colorscheme that uses the "normal" fonts for text and bold fonts for certain keywords on python.
This leads to wrong rendering of underscores with
Courier New
on Windows. The behaviour also depends on the screen (resolution?) used.On the Screenshot you see:
Courier New:h12
the underscores are missingCourier New:h12:b
), the underscores are visible again. When activating this, I can see that the spacing between lines changes to make room for the additional space needed.Courier New:h13
: Now the screen dependency kicks in: on a widescreen at the office, the underscores are half as thick as they should be. The screenshot was taken with a VPN on my Laptop (1280x800) and there they are rendered properlyCourier New:h16
: betweenh15
andh16
is the cutoff where NVim stops complaining aboutCourier New
not being a monospaced font. On the widescreen this is also the breaking point for rendering the underscores properly.My guess would be that there is not enough space for the bold glyphs to be rendered properly in "non bold mode" which leads to the most bottom pixels being truncated. The frameworks seems to know this since it's complaining about the font not being monospaced up to a threshold. This also happens i.e. for
Consolas
ath11
though I've been unable to pinpoint the exact display error there.Since
Courier New
is one of the classic fonts it would be nice for it to be properly supported.