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

No Ligatures support #44

Closed
kalkin opened this issue Mar 30, 2020 · 10 comments
Closed

No Ligatures support #44

kalkin opened this issue Mar 30, 2020 · 10 comments

Comments

@kalkin
Copy link

kalkin commented Mar 30, 2020

First of all thank you work your work. I'm using the Fira Code font, which provides ligatures i.e. for '=='. Eovim doesn't display ligatures, while e.g.: PHPStorm does.

I looked a little bit around, but I'm not sure what need to be done to fix.

  • eovim --version: eovim 0.1.3.99-25d452f
  • nvim --version | head -n1: NVIM v0.4.3
  • edje_cc --version:Version: 1.23.3
@jeanguyomarch
Copy link
Owner

I'm afraid that the GUI widget I'm using (evas textgrid) does not support ligatures :/

@jeanguyomarch
Copy link
Owner

From what I understand of ligatures support, the editor should detect by itself pattern such as -> and seamlessly replace it with another text glyph (such as →) for the user to see. Since this is monospaced, the width of the new glyph shall be equal to the sum of the widths of the original pattern (so here, a total width of 2).
This is where evas textgrid gets in the way... it should be able to render (at most) double width characters, but it does not seem to actually be implemented... so it seems that every glyph is always represented with a width of 1...
Unfortunately, evas textgrid is a key component of eovim's UI... so it either needs in-depth patching in core EFL, or be replaced.

@kalkin
Copy link
Author

kalkin commented Apr 21, 2020

Thank you for response. I'm surprised that EFL doesn't provide ligature support in a text widget, I thought it uses harfbuzz, or is my understanding of the problem to shallow and I missed something?

@jeanguyomarch
Copy link
Owner

The textgrid can display ligatures (what I understand are just different glyphs, that should span on multiple columns). However, it seems there is no support in the textgrid widget for multiple-width characters.

The textgrid causes each glyph to be rendered on exactly one cell, which causes large glyphs not to be of the appropriate size, and to be tiny. FOr example, in the image attached, you can see that the arrow that should ideally take two columns to "match" the width -> will alway uses only one column.

Screenshot from 2020-04-22 08-09-11

@kalkin
Copy link
Author

kalkin commented Apr 22, 2020

@jeanguyomarch
I think you are testing it wrong. The unicode sign is correctly only 1 char wide. You need to install some NerdFont variant i.e. fira-code. When using a specific font it will replace a '->' with an arrow which is actually two characters wide.

@kalkin
Copy link
Author

kalkin commented Apr 22, 2020

@jeanguyomarch
Copy link
Owner

Maybe I'm missing something, but I've tried this with FiraCode, but it yields the same result. I do not think it is the font that makes the substitution. From what I've seen in projects that implement support for automatic ligatures replacement, such as terminal emulators or code editors, it requires explicit support from the program. Here, I think eovim should detect specific patterns such as -> to replace it by a prettier glyph, that the font provides.

My problem with the textgrid is that I cannot use it to render glyphs that span on more than one column, because unfortunately, it does not seem to be implemented. This would not be the first limitation of the textgrid, as it lacks "undercurl" for example.

jeanguyomarch pushed a commit that referenced this issue Jun 5, 2020
Until now, Eovim was using the Evas_Textgrid to display text. It
consists in a fixed-size grid of codepoints associated with unique
glyphs and render attributes, such as the color and basic shape.

This has several problems, mainly:

- the textgrid has limited attributes support:
  - the color of underlined text is the same as the foreground
  - there is no "undercurl" equivalent
- you cannot specify a 'linespace' (#34)
- support for multiple width character is partial
- you cannot use the opentype capabilities such as ligatures (#44)

It was time for a change to support the above. Eovim now uses
Evas_Textblock, which is low-level rich text widget provided by EFL.
However, it is tricky to use the same way than the Textgrid, but a
proper separation between model/view/controller (wow... so innovative)
actually makes surprisingly it trivial to handle!

Fix #34
Fix #44
jeanguyomarch pushed a commit that referenced this issue Jun 5, 2020
Until now, Eovim was using the Evas_Textgrid to display text. It
consists in a fixed-size grid of codepoints associated with unique
glyphs and render attributes, such as the color and basic shape.

This has several problems, mainly:

- the textgrid has limited attributes support:
  - the color of underlined text is the same as the foreground
  - there is no "undercurl" equivalent
- you cannot specify a 'linespace' (#34)
- support for multiple width character is partial
- you cannot use the opentype capabilities such as ligatures (#44)

It was time for a change to support the above. Eovim now uses
Evas_Textblock, which is low-level rich text widget provided by EFL.
However, it is tricky to use the same way than the Textgrid, but a
proper separation between model/view/controller (wow... so innovative)
actually makes surprisingly it trivial to handle!

Fix #34
Fix #44
jeanguyomarch pushed a commit that referenced this issue Jun 5, 2020
Until now, Eovim was using the Evas_Textgrid to display text. It
consists in a fixed-size grid of codepoints associated with unique
glyphs and render attributes, such as the color and basic shape.

This has several problems, mainly:

- the textgrid has limited attributes support:
  - the color of underlined text is the same as the foreground
  - there is no "undercurl" equivalent
- you cannot specify a 'linespace' (#34)
- support for multiple width character is partial
- you cannot use the opentype capabilities such as ligatures (#44)

It was time for a change to support the above. Eovim now uses
Evas_Textblock, which is low-level rich text widget provided by EFL.
However, it is tricky to use the same way than the Textgrid, but a
proper separation between model/view/controller (wow... so innovative)
actually makes surprisingly it trivial to handle!

Fix #34
Fix #44
jeanguyomarch pushed a commit that referenced this issue Jun 5, 2020
Until now, Eovim was using the Evas_Textgrid to display text. It
consists in a fixed-size grid of codepoints associated with unique
glyphs and render attributes, such as the color and basic shape.

This has several problems, mainly:

- the textgrid has limited attributes support:
  - the color of underlined text is the same as the foreground
  - there is no "undercurl" equivalent
- you cannot specify a 'linespace' (#34)
- support for multiple width character is partial
- you cannot use the opentype capabilities such as ligatures (#44)

It was time for a change to support the above. Eovim now uses
Evas_Textblock, which is low-level rich text widget provided by EFL.
However, it is tricky to use the same way than the Textgrid, but a
proper separation between model/view/controller (wow... so innovative)
actually makes surprisingly it trivial to handle!

Fix #34
Fix #44
jeanguyomarch pushed a commit that referenced this issue Jun 5, 2020
Until now, Eovim was using the Evas_Textgrid to display text. It
consists in a fixed-size grid of codepoints associated with unique
glyphs and render attributes, such as the color and basic shape.

This has several problems, mainly:

- the textgrid has limited attributes support:
  - the color of underlined text is the same as the foreground
  - there is no "undercurl" equivalent
- you cannot specify a 'linespace' (#34)
- support for multiple width character is partial
- you cannot use the opentype capabilities such as ligatures (#44)

It was time for a change to support the above. Eovim now uses
Evas_Textblock, which is low-level rich text widget provided by EFL.
However, it is tricky to use the same way than the Textgrid, but a
proper separation between model/view/controller (wow... so innovative)
actually makes surprisingly it trivial to handle!

Fix #34
Fix #44
jeanguyomarch pushed a commit that referenced this issue Jun 6, 2020
Until now, Eovim was using the Evas_Textgrid to display text. It
consists in a fixed-size grid of codepoints associated with unique
glyphs and render attributes, such as the color and basic shape.

This has several problems, mainly:

- the textgrid has limited attributes support:
  - the color of underlined text is the same as the foreground
  - there is no "undercurl" equivalent
- you cannot specify a 'linespace' (#34)
- support for multiple width character is partial
- you cannot use the opentype capabilities such as ligatures (#44)

It was time for a change to support the above. Eovim now uses
Evas_Textblock, which is low-level rich text widget provided by EFL.
However, it is tricky to use the same way than the Textgrid, but a
proper separation between model/view/controller (wow... so innovative)
actually makes surprisingly it trivial to handle!

Fix #34
Fix #44
jeanguyomarch pushed a commit that referenced this issue Jun 6, 2020
Until now, Eovim was using the Evas_Textgrid to display text. It
consists in a fixed-size grid of codepoints associated with unique
glyphs and render attributes, such as the color and basic shape.

This has several problems, mainly:

- the textgrid has limited attributes support:
  - the color of underlined text is the same as the foreground
  - there is no "undercurl" equivalent
- you cannot specify a 'linespace' (#34)
- support for multiple width character is partial
- you cannot use the opentype capabilities such as ligatures (#44)

It was time for a change to support the above. Eovim now uses
Evas_Textblock, which is low-level rich text widget provided by EFL.
However, it is tricky to use the same way than the Textgrid, but a
proper separation between model/view/controller (wow... so innovative)
actually makes surprisingly it trivial to handle!

Fix #34
Fix #44
@jeanguyomarch
Copy link
Owner

For details, there is also now a dedicated wiki page

@kalkin
Copy link
Author

kalkin commented Jun 6, 2020

@jeanguyomarch Awesome. Thank you for putting work in to it.

Do I need neovim >4 to use the current HEAD?

@jeanguyomarch
Copy link
Owner

Yes indeed, it seems that eovim is currently broken with < 0.4.

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