rogual / neovim-dot-app

Mac OS X GUI for Neovim
1.13k stars 62 forks source link

Support ligatures. #107

Open jordwalke opened 8 years ago

jordwalke commented 8 years ago

Some fonts, such as https://github.com/tonsky/FiraCode have ligatures and it would be great to support them.

davidosomething commented 8 years ago

+1

kitten commented 8 years ago

Me and @rogual are currently looking into rendering text more efficiently with CoreText. This would essentially support ligatures as well, I suppose. But we should keep in mind that the current rendering is very similar to iTerm's, which also doesn't support ligatures (?).

jordwalke commented 8 years ago

@philplckthun, Correct - I'm suggesting a way that neovim-dot-app could distinguish itself by offering features that other implementations don't support.

kitten commented 8 years ago

The commit I referenced modifies my PR to render characters together, thus allowing ligatures.

Check out PR #109 for more info.

kitten commented 8 years ago

@rogual Can be closed?

bambu commented 8 years ago

Agreed. I have been using FiraCode + Neovim.app since #109 was merged and it seems to work nicely.

rogual commented 8 years ago

@philplckthun No, I still need to test this. Just want to make sure ligatures work reliably, and not the sort-of-working that RTL text used to have.

jordwalke commented 8 years ago

I'm not exactly using the latest version, but often, when I type characters the ligatures don't draw. I have to highlight them with visual selection for them to rerender properly.

kitten commented 8 years ago

@jordwalke When Neovim/Vim draws new characters it draws them separately - naturally. Thus they are also rendered separately and the ligatures aren't drawn immediately. They only show up when the line is drawn as a whole.

This can't be fixed easily. We'd need a highly complex rendering system to circumvent these problems.

rogual commented 8 years ago

Then this is a bug, and does not constitute support for ligatures. They need to be rendered correctly or not at all.

jordwalke commented 8 years ago

My suggestion in another neovim frontend was to keep track of drawn line content and always redraw individual lines as one unit using CoreText (or whatever). That would ensure that ligatures are always rendered correctly.

rogual commented 8 years ago

Yeah, sounds like the way to go.

jamischarles commented 8 years ago

Ligatures seem to be turned on for me (I'm using Menlo). It's causing some scroll position issues. Is there a way to turn this off?

rogual commented 8 years ago

No, it's a bug. OSX is being clever and sometimes rendering ligatures when we happen to draw several chars at the same time.