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

Take column into account when rendering cells for perfect patterned underline rendering #4349

Closed
Tyriar opened this issue Dec 23, 2022 · 4 comments · Fixed by #4703
Closed
Assignees
Labels
area/addon/canvas area/addon/webgl type/enhancement Features or improvements to existing features

Comments

@Tyriar
Copy link
Member

Tyriar commented Dec 23, 2022

Forking off from #4060

Thinking about this and the fact that I want xterm.js rendering to be as great as possible, I think we should support multiple glyphs depending on the x-axis when necessary. For the dotted line specifically, say we had a dot of size window.devicePixelRatio with the same sized gap in-between, so there would be at most 2 possible variants for every glyph:

Even:
|* * * * |

Odd:
|* * * * *|
| * * * * |

To store this as a unique glyph we need to make the glyph key different, this could be done by asking what underline variant it is and then store it as a number, maybe capped at 4 (2 bits) or 8 variants (3 bits)?

This would allow us make a non-repeated curvy line and not restrict us to a single cell for both the up and down parts of the wave, if that ends up looking better of course.

Current:

image
image

Desired:

image
image

@Tyriar Tyriar added type/enhancement Features or improvements to existing features area/addon/webgl area/addon/canvas labels Dec 23, 2022
@tisilent
Copy link
Contributor

tisilent commented Apr 19, 2023

企业微信截图_16818975586554
Maybe this effect will be better?

@tisilent
Copy link
Contributor

hi @Tyriar ,
企业微信截图_16922683211768
Is this the effect 😆

@tisilent
Copy link
Contributor

Enlarge the image to view.
I haven't processed Zoom yet.

@Tyriar
Copy link
Member Author

Tyriar commented Aug 17, 2023

@tisilent yes the circles part is one of the problems this is calling out. Basically we want a perfectly repeating pattern for dotted and dashed. My thinking was to offset the underline based on the column, then make sure that the same underlines are shared between glyphs in the texture atlas.

One of the harder parts of this is to make sure it works across all font sizes and zoom levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/addon/canvas area/addon/webgl type/enhancement Features or improvements to existing features
Projects
None yet
2 participants