yatli / fvim

Cross platform Neovim front-end UI, built with F# + Avalonia
MIT License
1.34k stars 30 forks source link

Issues rendering italic and underlines #60

Closed nree closed 5 years ago

nree commented 5 years ago

Untitled

Sorry for poor job on the pic but: Top line is fvim Bottom line is cmder / conemu running vim (nvim)

This is Windows 10, using same font (SF Mono), same vim config, same wsl / neovim.

I tried different fonts:

I've tested fonts on other apps: Cmder (conemu) in the picture, tested with visual studio code, and emacs.

yatli commented 5 years ago

interesting. looks like the font measurement function calcs off. for height, you can workaround this by setting :FVimFontLineHeight (for example, :FVimFontLineHeight '+1.0')

yatli commented 5 years ago

The horizontal clipping is weird. fvim conducts backward rendering so if the line comes in, later glyphs will be drawn first.

yatli commented 5 years ago

The horizontal clipping is repro'ed and I think I've pinpointed the issue:

https://github.com/yatli/fvim/blob/4e77a9b93630d9b4714c532a9308b844e7a5686d/ui.fs#L342-L348

note that only the last glyph of an italic span gets clipped.

yatli commented 5 years ago

@nree I'll push out a release soon. it should be fixed

nree commented 5 years ago

Looks very very good now! Some of the best I've seen 😁

Regarding line height issue: (italic g, y + underline) I noticed something new... it actually renders good (first render). But then on re-renders after it will clip. Is this a bug? So it seems possible to render these height issues good, just something in the render clips them after. Should I open new issue about this? Opening new issue