Nvy icon indicating copy to clipboard operation
Nvy copied to clipboard

nvy has display issues

Open LollipopFt opened this issue 3 years ago • 11 comments

image a very minor offset for only a few lines can be seen near the bottom of the screen.

LollipopFt avatar Sep 29 '21 15:09 LollipopFt

This is odd. Can you share some more information so I can try and debug this, such as font, font size and theme related stuff that may interfere with the rendering.

RMichelsen avatar Sep 29 '21 16:09 RMichelsen

nevermind, it's gone... seems like a one-off thing, but strange that it happened. font: fira code, cascadia code font size: 11 theme: tokyonight.nvim note: nvim-treesitter enabled.

LollipopFt avatar Sep 30 '21 16:09 LollipopFt

Hmmm, strange. If you find a way to reproduce it in the future please reopen the issue :)

RMichelsen avatar Sep 30 '21 16:09 RMichelsen

@RMichelsen I'm also experiencing lots of rendering issues with JetBrainsMono NF (Nerd font) while basic Consolas seems fine. Especially with powerline symbols and apparently bold text:

image

In the above example both the line number at cursor and return are bold which makes them push the rest of characters to the right.

EtiamNullam avatar Dec 15 '21 18:12 EtiamNullam

@EtiamNullam I am unsure what could be causing this, Nvy uses DirectWrite to render the glyphs and for bold text for example it simply sets the font weight of the corresponding text: https://github.com/RMichelsen/Nvy/blob/master/src/renderer/renderer.cpp#L412

I will have try and look into why it doesn't preserve the uniform spacing (which any monospace font should). Is it only JetbrainsMono NF that has this issue? How about the non-NF version for example?

RMichelsen avatar Dec 15 '21 18:12 RMichelsen

JetBrainsMono also works fine for me. Looks like FuraCode NF also has problems while BlexMono NF looks fine.

nvim-qt reports JetBrainsMono NF is not a fixed pitch font so its most likely a problem with certain nerd fonts. Only in Nvy though - its fine in nvim (console), nvim-qt and neovide - so it might still be worth looking into.

EtiamNullam avatar Dec 15 '21 20:12 EtiamNullam

I wonder if there is a setting somewhere to make DirectWrite enforce a fixed width. nvim and neovide do not use DirectWrite so they may have other means of solving that problem. I'm actually not sure nvim-qt does either. I will have to investigate. In any case I'm not sure there is much I can do without either figuring out a DirectWrite option or figuring out some workaround hack which I would really rather avoid. Hmm.

I probably won't get a fix out for this right away as I have some IRL things to attend to at the moment, I will try to remember to look into it as soon as I get time. Feel free to mess around with it yourself and submit a PR if you find a good solution.

RMichelsen avatar Dec 15 '21 20:12 RMichelsen

Proportional font users, rejoice! Only missing ingredient is character-width based cursor and I will ditch Vscode in an instant. image

tejasvi avatar Feb 11 '22 11:02 tejasvi

Looks like I had wrongly configured fonts, when downloading JetBrains Mono from nerdfonts I have only installed Regular fontface. Looks like Bold and Italic (possibly also ItalicBold) were needed otherwise Nvy tried to change the font on its own or something, making letter not fit the grid when styling like italic or bold is applied.

EtiamNullam avatar Apr 27 '22 23:04 EtiamNullam

Is this still reproducible? If I understand it correctly the bug happens even with monospaced fonts? - I don't think I have any plans to support anything other than monospace fonts for the time being. Neovim being a row/column grid-based editor I don't think time should be spent on proportional fonts

RMichelsen avatar Sep 06 '22 13:09 RMichelsen

@RMichelsen: Yes it can also happen for monospaced fonts.

If font doesn't have Bold or Italic (ItalicBold?) fontfaces installed and these styles are applied then these effects would be created out of regular fontface, tilting characters for Italic or making them larger for Bold. Both of these effects result in characters having bigger width and pushing the rest of characters to the side. In Neovide these characters would be clipped to fit in the grid.

It would be nice if user would be acknowledged that font is lacking required fontface (like in neovim-qt) and maybe it should fallback to using regular fontface if Bold or Italic are not supported. Of course you can also clip the character to fit in the grid (like in Neovide) but it can look bad.

EtiamNullam avatar Sep 06 '22 15:09 EtiamNullam