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

text style: underline #79

Closed
raphamorim opened this issue Jun 3, 2023 · 5 comments
Closed

text style: underline #79

raphamorim opened this issue Jun 3, 2023 · 5 comments
Labels
Sugarloaf wishlist Features wishlist
Milestone

Comments

@raphamorim
Copy link
Owner

Implement underline feature in the sugarloaf. Rio and Crosswords already provide an information if the square/cell is underlined, would be similar to the way flag is working for bold, italic and bold_italic https://github.com/raphamorim/rio/blob/main/rio/src/screen/state.rs#L193-L203

@raphamorim raphamorim added wishlist Features wishlist Sugarloaf labels Jun 3, 2023
@raphamorim raphamorim added this to the 0.0.6 milestone Jun 3, 2023
@raphamorim raphamorim changed the title underline text styles text style: underline Jun 3, 2023
@niuez
Copy link
Contributor

niuez commented Jun 3, 2023

examples from other terminals. left is character underline, right is cursor underline. selection is to visualize glyph min and max y.

alacritty

  • character underline and cursor underline is same.
  • the bottoms of both underlines are same to the bottom of glyph.
image
  • character underline and cursor underline is not same y position.
  • the bottom of cursor underline is the same to the bottom of glyph.
  • the bottom of character underline is placed by underline position of font information.
image

the implementation of alacritty is easy. but using font information is strict.

@raphamorim
Copy link
Owner Author

I like more Alacritty implementation (character underline and cursor underline is same), feels a bit off cursor style that specify underline do a different rendering that a normal text underline. What you think?

@niuez
Copy link
Contributor

niuez commented Jun 4, 2023

I have never used underline cursor, so I wanted to hear from anyone with an opinion.
Appearance aside, I think Alacritty's method is easy if we want just implementing underline feature. It can be changed after.

@raphamorim
Copy link
Owner Author

yup, we can start with alacritty's way and later revisit as well. Although might bump into this same type of problems alacritty/alacritty#3471 (if the cursor doesn't differentiate at least bit)

@raphamorim
Copy link
Owner Author

Thinking about it, I don't believe we are able to do the second approach until rewrite the font loader. For now implemented Strikethrough and Underline using the sugardecoration but I think we can revisit it later once we have the font loader more stable (need to rewrite it due to #80 and WASM support).

Below some screenshots with underline and strikethrough using same approach as alacritty.

Screenshot 2023-06-05 at 08 56 22 Screenshot 2023-06-05 at 09 00 50 demo-text-styles

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

No branches or pull requests

2 participants