Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ligatures. #49

Open
jordwalke opened this issue Aug 30, 2015 · 2 comments
Open

Support ligatures. #49

jordwalke opened this issue Aug 30, 2015 · 2 comments

Comments

@jordwalke
Copy link

I took a look at ui.coffee and it seems like supporting ligatures would be within reach. Ligatures are great because modern programming fonts are beginning to include support for awesome symbols for functional languages etc.:

For example, see https://github.com/tonsky/FiraCode

It looks like the canvas drawText API that you're using supports ligatures but it merely requires that you draw the two/three characters in one call to drawText. I saw that neovim-e draws one character at a time, however.

Should there be some intermediate representation that neovim-e keeps track of instead of just executing raw single character draw/put commands? Could neovim-e maintain an up to date representation of the entire screen so that when anything changes, something like a "mini react" can find the characters that are likely dirty and draw only those lines (and the entire lines so that ligatures will render correctly)?

@coolwanglu
Copy link
Owner

The current implementation with canvas was partially from Vim.js, another project of mine, and partially for performance concerns. And of course it'd be easier to support ligatures with html tags.

I think your "redrawing dirty lines" idea should work, but we need to keep track of the content on screen that way.

@jordwalke
Copy link
Author

Each line may have multiple colors/weight. Does that complicate things? I think we'd want to redraw dirty "ranges" of contiguous color/weight. Either way, having an intermediate representation seems very useful. I'd urge you to avoid using the DOM at all and I commend your choice of canvas (GL is a great option too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants