-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Curly underline is rendered as single #16288
Comments
There are two issues in this Issue 1. Curly line drawn as Singly lineAdmittedly, I've a high dpi screen which I use at 175% scaling. I guess the threshold we kept for curly underlines can be fine tuned for 100% display scaling. Something that works for 100% should work for 175% as well 🙂 Can someone try a different value for AtlasEngine (WT) terminal/src/renderer/atlas/BackendD3D.cpp Lines 311 to 313 in d14524c
GDI (Conhost) terminal/src/renderer/gdi/state.cpp Lines 410 to 432 in d14524c
In GDI, we have two conditions to check before drawing curly underline:
2. Underlines not visible at smaller font-sizes in Conhost
I guess the underline offset we're calculating is making underlines to be drawn below the cell bottom, effectively making them not visible at all. A fix could be to clamp the offset within cell boundary🤔 (For me, this happens at font-size 9px with Consolas.) |
The line offsets should have already been set to their correct positions based on the provided font metrics in the terminal/src/renderer/gdi/paint.cpp Lines 622 to 626 in d14524c
That's almost certainly wrong. Even if if wasn't pushing the offsets out of range, it doesn't make sense to be altering the value here. What was the reason for this change? Edit: I see now it's probably because the single and double underline are now rendered with |
Also, assuming you're looking at this code again, note that the terminal/src/renderer/gdi/state.cpp Lines 379 to 383 in d14524c
So I think the test below should never be necessary. terminal/src/renderer/gdi/state.cpp Lines 409 to 413 in d14524c
|
I'm gonna pull this one out of the triage queue and assign it to you, Tushar! Let me know if you have any objections. Thanks for working on underlines! |
Hey @tusharsnx, I've got a crazy plan... but it might need this bug fixed for me to pull it off 😁 (are you able to look into it?) |
Almost ready! 🙂 |
Okay I definitely thought that's what you meant on Twitter, I just had to make sure! |
Fixes Curlyline being drawn as single underline in some cases **Detailed Description** - Curlyline is drawn at all font sizes. - We might render a curlyline that is clipped in cases where we don't have enough space to draw a full curlyline. This is to give users a consistent view of Curlylines. Previously in those cases, it was drawn as a single underline. - Removed minimum threshold `minCurlyLinePeakHeight` for Curlyline drawing. - GDIRender changes: - Underline offset now points to the (vertical) mid position of the underline. Removes redundant `underlineMidY` calculation inside the draw call. Closes #16288
Fixes Curlyline being drawn as single underline in some cases **Detailed Description** - Curlyline is drawn at all font sizes. - We might render a curlyline that is clipped in cases where we don't have enough space to draw a full curlyline. This is to give users a consistent view of Curlylines. Previously in those cases, it was drawn as a single underline. - Removed minimum threshold `minCurlyLinePeakHeight` for Curlyline drawing. - GDIRender changes: - Underline offset now points to the (vertical) mid position of the underline. Removes redundant `underlineMidY` calculation inside the draw call. Closes #16288 (cherry picked from commit f5b45c2) Service-Card-Id: 91349182 Service-Version: 1.19
Windows Terminal version
1.20.3131.0
Windows build number
10.0.19045.3448
Other Software
No response
Steps to reproduce
Originally posted in #16097 (comment)
Set display scaling to 100%
Run OpenConsole or WT
Set font to Consolas
Set font size to:
Run something to showcase new underlines, e.g. this script
- where � is \x1b, or whatever else you might have.
Expected Behavior
Clearly visible underline styles, curly in particular, e.g.:
Actual Behavior
Curly is rendered as single in both OpenConsole and WT:
OpenConsole also renders double underline as single, which may or may not be related.
Other terminals, e.g. wezterm, seemingly have no issues with even smaller sizes:
Technically it's not too small if the wave height is at least 2 pixels:
![image](https://private-user-images.githubusercontent.com/11453922/282096801-d6782c1a-2c47-44b7-93e3-02de8fa6fdf8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzA3MDUsIm5iZiI6MTczOTE3MDQwNSwicGF0aCI6Ii8xMTQ1MzkyMi8yODIwOTY4MDEtZDY3ODJjMWEtMmM0Ny00NGI3LTkzZTMtMDJkZThmYTZmZGY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA2NTMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZhZTcyODA1YzFlODhkZWU3OTI5MzViZWRmZWYxNjg0ZjFkMGE0NmE2ZjM1Mjk0OTliMmE0ZjMyOTNmMzg2M2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ymRupiSgY85Y2ypXcZiiSJVoDHZDLTrCatsaVZWUEoQ)
Additionally, OpenConsole with even smaller sizes, e.g. Consolas 15, doesn't render anything but "double" at all:
Technical limitations are understandable, but, assuming that the key selling point of this feature is spellchecking, any ugly/incorrect/clipping/overlapping rendering would be better than nothing at all.
The text was updated successfully, but these errors were encountered: