qvacua / vimr

VimR — Neovim GUI for macOS in Swift
https://twitter.com/VimRefined
MIT License
6.6k stars 218 forks source link

Support for Proportional Fonts #722

Open sriharshachilakapati opened 5 years ago

sriharshachilakapati commented 5 years ago

When I'm trying to open a JSON file with Telugu Unicode text in it, VimR immediately crashes. However this is not found in terminal NVIM.

Using VimR 0.24.0 Using NVIM v0.3.4

Attaching the crash file (changed extension to .log because GitHub doesn't allow otherwise).

The file I'm trying to open can be found here: https://github.com/sriharshachilakapati/yakyak/blob/master/src/locales/te.json

VimR_2019-04-21-160553_Harshas-MacBook-Pro.crash.log

iTerm + TMUX + NVIM doesn't crash for me, but the text is appearing distorted.

sriharshachilakapati commented 5 years ago

Tried with updated VimR version. It's not crashing anymore, but not rendering fine too. Can we do something to support proportional fonts?

Output:

VimR

NVIM TUI

Expected: (Rendered by Xcode)

Xcode

That character <200c> is a zero width joiner. It should not be rendered at all.

qvacua commented 5 years ago

@sriharshachilakapati Have you tried to turn on the "Use Ligatures" option in the Appearance preferences?

sriharshachilakapati commented 5 years ago

Yes @qvacua, I had ligatures enabled. I think the problem is that nvim and vimr both are not accepting the diacritics well. In Telugu and many other indic languages, diacritic characters can be added to the base character on top, bottom right of the base character.

Ligatures are important here, and I can see that the ligatures are rendered properly. Nothing wrong there. Only thing is that the advance widths are not taken into account, and hence I can see that the letters are overlapped on themselves.

There is nothing I can do to get it to work with TUI of nvim, because there I'm pretty much sure that the entire screen space will be divided into a character grid. So this is the reason I thought I can rely on the GUI.

Can you explain me how the text rendering is happening in VimR?