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

How do I customize the underline position and width? #55

Open
UtkarshVerma opened this issue Feb 24, 2022 · 5 comments
Open

How do I customize the underline position and width? #55

UtkarshVerma opened this issue Feb 24, 2022 · 5 comments

Comments

@UtkarshVerma
Copy link
Contributor

The underline looks a bit thicker than I prefer. Here's a comparison between Alacritty and st.
image

Is there a way I could make the underline thinner, and maybe position it a couple of pixels below?

@bakkeby
Copy link
Owner

bakkeby commented Feb 24, 2022

Hmm, changing the + 1 here to + 2 gives a 1 pixel space between the text and the underline.

st-flexipatch/x.c

Lines 2304 to 2305 in 4a156b9

XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent + 1,
width, 1);

If I changed that to + 3 then it disappeared as the next line (my prompt) was overwriting it. Maybe + 2 is enough here.

@UtkarshVerma
Copy link
Contributor Author

Weirdly, that doesn't work for me. I don't see any difference. Here are the patches I'm using: https://github.com/UtkarshVerma/st-flexipatch/blob/mine/patches.h

@bakkeby
Copy link
Owner

bakkeby commented Feb 24, 2022

Right, you are using the undercurl patch which has various underline variants. Not sure how exactly to adjust that.

@UtkarshVerma
Copy link
Contributor Author

I decided to disable undercurl patch, and got what I wanted by modifying the source. However, I feel a variable for configuring this would be better. What are your thoughts on this?
Also, I'm using +3 offset for my underline and it looks perfect.

@UtkarshVerma
Copy link
Contributor Author

I did a minor change in the source to set offset for the undercurl patch in UtkarshVerma@5649ac6

It doesn't allow setting width of the underline though.

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