glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.
GNU General Public License v3.0
4.65k stars 143 forks source link

Ligature support #1542

Open musjj opened 1 year ago

musjj commented 1 year ago

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 commented 1 year ago

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.

alerque commented 1 year ago

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...