onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.36k stars 301 forks source link

Devanagari (and other complex scripts) Support #2623

Open pranphy opened 5 years ago

pranphy commented 5 years ago

Is there any chance that Oni will support complex scripts (among others) like Devanagari (देवनागरी)? It would be really great if this feature was implemented in Oni, so that we do not have to switch to a different editors when editing documents in our language sacrificing all the strength of vim. For example VSCode already has this support. In this image the editor in the left is VSCode and on the right is Oni displaying the same file.

image

justinmk commented 5 years ago

did you try :help 'ambiwidth'

pranphy commented 5 years ago

:set ambiwidth=double did not help.

badosu commented 5 years ago

Can you try with the "editor.renderer": "canvas" oni config?

pranphy commented 5 years ago

That did not make any difference either.

SundarTM commented 5 years ago

The UI model proposed by Nvim UI protocol consists of a terminal-like grid with a single, monospace font size. Most Indic scripts do not have a monospace font. They only have variable-width fonts.

The issue reported here is caused by Oni trying to render the variable-width characters in a equally spaced grid. Here is an example of the issue, while rendering the Tamil text "வணக்கம் நண்பர்களே!!!".

variable width font issue

Oni might be able to workaround this by adjusting the individual grid-cell size according to the glyph size. But I reckon a proper fix might need changes also in the Neovim core to adapt a redesigned UI model and a more advanced screen display logic.

@justinmk Can you comment on this? What changes will be required in Nvim/Oni to support Proportional Fonts? Will it be feasible?

It would be great If Neovim and Oni could enable Indic script editing by adding proportional fonts support.