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

Ligature support #1542

Open
musjj opened this issue Jun 15, 2023 · 2 comments
Open

Ligature support #1542

musjj opened this issue Jun 15, 2023 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@musjj
Copy link

musjj commented Jun 15, 2023

It would be nice if ligature can be supported. I'm using JetBrainsMono and ligatures work just fine on GitHub code blocks. But it's not working inside firenvim.

@glacambre
Copy link
Owner

I'm not sure if this is possible to do in a generic and efficient way for Firenvim. Firenvim has no actual knowledge of the font being used and I don't know of any canvas APIs that would check if a pair of characters would be rendered with ligatures. The only solution I can think of is to render each pair of characters first "normally" and then twice by changing the second character of the pair and comparing whether the results are pixel-for-pixel identical.
It also asks some interesting questions about what neovim highlights should be used to render ligatures when the underlying cells have different highlight ids.

@glacambre glacambre added the help wanted Extra attention is needed label Jun 15, 2023
@alerque
Copy link
Contributor

alerque commented Jun 15, 2023

I don't know about the Canvas interface issues. Just a couple random thoughts even though I don't feel any need for this personally...

  • You'll probably need to bundle and call out to an actual shaping engine to get this right: for example Harfbuzz can now be compiled to WASM.
  • As for syntax highlighting issues, I'm guessing you never want to ligature across a highlight group boundary.
  • There are other NeoVIM interfaces that support ligatures, for example Neovide. It is probably worth reviewing their implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants