-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Configuration for undercurl vertical offset #17482
Comments
I'd like to reproduce the issue first, before adding any settings. It could be a bug in our renderer after all. Can you please tell me the following?
|
I think what I would like to see is a minimum integer number of pixels separation, no matter the font size. Even 1 pixel would be great. It would also be nice to be able to specify the pk-2-pk height of the curl, but that's just a nice to have. |
Note that the collision is not as bad if I can set the undercurl color to be different than the font color. And I do have that set in nvim. But there is some kind of problem such that color works when not in tmux, but does not work in tmux (EXCEPT in MateTerminal it does work??? You can see that in the MateTerm grab above.). One day, I'll figure it out. But for now... |
I think there are two problems:
In other words:
|
After spending way too much time in desmos's graphing calculator I realized that I can calculate the distance to the tangent of the sin curve quite easily while being a sufficient approximation. The tangent for That's such a fantastic coincidence because This is what we already have: float s = sin(data.position.x * frequency);
float d = abs(curlyLineHalfHeight - data.texcoord.y - s * amplitude); and all that was missing was a tiny float s = sin(data.position.x * frequency);
float d = abs(curlyLineHalfHeight - data.texcoord.y - s * amplitude) * rsqrt(2 - s * s); |
IMO The sine wave does not need antialiasing even at a few pixels scale since it is quite symmetrical. Antialiasing only blurs it (this is just as ugly as using vertical AA for a single underline). Here are examplesof aliased wavy underlines (first with aliased glyphs and the second with AA glyph rendering)Aliased glyphs: screen_record_Sat_06.29.2024_12-44-41.58.aliased.mp4Antialiased glyphs: screen_record_Sat_06.29.2024_12-49-16.50.aa.mp4You can play with it using built artifacts https://github.com/directvt/vtm/actions/runs/9722846266 (or just build https://github.com/o-sdn-o/vtm/tree/gui-bridge) with the following config in <config>
<gui>
<antialiasing = off />
<cellheight = 20 />
<gridsize = 0,0 />
<wincoor = 0,0 />
<winstate = normal />
<blinkrate = 400ms />
<fontlist> <!-- Font fallback list (LF-delimited (\n), ordered). The rest of the fonts available in the system will be loaded dynamically. -->
"Courier New\n" <!-- Primary font. Its metrics define the cell geometry. -->
"Cascadia Mono\n"
"Fira Code\n"
"NSimSun\n"
"Noto Sans Devanagari\n"
</fontlist>
</gui>
<menu>
<item id="Test" type=dtvt param="$0 -r test"/>
</menu>
</config> Use the |
Undercurl is colliding with the bottom of the font. Requesting a configuration to apply a y-offset from the default vertical placement.
Here are some other-term links that may prevent having to think it through from scratch.
kovidgoyal/kitty#853
microsoft/cascadia-code#395
https://wezfurlong.org/wezterm/config/lua/config/underline_position.html
The text was updated successfully, but these errors were encountered: