Open ProgramFan opened 5 years ago
You can try workaround with GuiLinespace command with -4 argument.
Thanks. I tried but it only distorts the line further. Then I think this is more than calculating the line height. VTE uses such a strange way to calculate cell height and cell width. There must be a deep reason.
Describe the bug neovim-gtk produces large line height with nerd font
DejaVuSansMono Nerd Font Mono
on Fedora 29. The line height is about 4 pixels larger than that the same configuration in gnome-terminal and makes the status line looking bad.After digging into the source code, I found nvim-gtk calculate line height in this way at https://github.com/daa84/neovim-gtk/blob/6a7804c6e797142724548b09109cf2883cd6f08c/src/render/context.rs#L119:
With fonts like the nerd font family, some glyphs have larger ascents than the usual characters, thus makes the line height larger.
After going through the vte code, I found that it deals with cell width in a different way. Actually, vte pre-calculates cell height by pre-rendering a line of ascii visible chars and estimating the logical box. The logic is like the following code:
Can neovim-gtk implement the same logic? Unfornately I am not familiar with rust.
Technical information (please complete the following information):