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

black lines in background when using midnight commander or neovim #3626

Closed
ducaale opened this issue Nov 19, 2019 · 16 comments · Fixed by #5149
Closed

black lines in background when using midnight commander or neovim #3626

ducaale opened this issue Nov 19, 2019 · 16 comments · Fixed by #5149
Assignees
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@ducaale
Copy link

ducaale commented Nov 19, 2019

Environment

Windows build number: 10.0.18363.476
Windows Terminal version (if applicable): 0.6.2951.0

Steps to reproduce

Run midnight commander mc with fontSize equal to 12 and with cascadia code or consolas font.
It is worth noting that with fontSize 14 or 10 the background renders correctly without black lines.

Expected behavior

Background should be blue with no black lines
Screenshot (29)

Actual behavior

Background has black lines
Screenshot (31)

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 19, 2019
@j4james
Copy link
Collaborator

j4james commented Nov 19, 2019

I suspect this is a duplicate of #455.

@egmontkob
Copy link

I don't think it's a duplicate. Although that bug also has two screenshots equivalent to the one here, one of them also showing mc in particular, that bug talks about the line drawing characters (i.e. the foreground) not touching each other.

This bug is here talks about the background color (blue) not filling the entire cell, leaving a gap.

In this screenshot over here, the period (from the top of a black line to the top of the next black line) is 57 pixels. Also if you magnify and look closely at some repeated piece of text (e.g. all those "4096"s), you'll see that antialiasing goes differently in every second row. In the upper row of each blackline-separated area, horizontal lines (e.g. the ones of digits 2, 4, the serif of 1, i, r etc.) are 2 pixels tall and super crispy. In every lower row these are uglier 1 pixel half-blue-half-white antialiased + 1 pixel white + 1 pixel half-blue-half-white antialiased.

So a row's height is 28.5 pixels, each text row is presumably 28.5 pixels below the previous one, and here and there (e.g. when rendering the background) rounding to integers kicks in.

Totally sounds like a HiDPI related story.

@egmontkob
Copy link

... although the screenshot of the entire desktop is 1920x1080, which is not HiDPI, unless the screenshot taking software downscaled it in which case who knows what other nasty things it did :) @ducaale What's your monitor's resolution?

A few other things to note:

Those black lines aren't really black, just something darker than desired. It depends based on the neighboring two background colors. It's different between cyan and blue (under "Command Options Right"), between blue and cyan (under "Name Size Modify time") [yup the order of colors also seems to matter], cyan and white (under "Left File Command") etc.

There are some such vertical lines, too, namely either before or after(*) the vertical line drawing chars. (*)Presumably according to the parity, I haven't verified.

@j4james
Copy link
Collaborator

j4james commented Nov 19, 2019

You can see the same sort of DPI scaling issues in #2496, #2779, and #2790, all of which were marked as duplicates of #455. I think the title of #455 is a bit misleading, and isn't necessarily a good indication of the underlying cause of the problem.

@ducaale
Copy link
Author

ducaale commented Nov 19, 2019

@egmontkob Yes the resolution is 1920x1080 with 150% scaling.

@egmontkob
Copy link

You can see the same sort of DPI scaling issues in #2496, #2779, and #2790

Indeed those three bugs are the same as this one.

I think the title of #455 is a bit misleading

Or rather let's say: #455 is two technically different issues squeezed into one.

with 150% scaling

How does 150% scaling result in every second row being different? I have no idea :D

@DHowett-MSFT
Copy link
Contributor

I'm guessing that this is one of those classic D2D 0.5-pixel offset issues 😁

@DHowett-MSFT DHowett-MSFT added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 21, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Nov 21, 2019
@DHowett-MSFT DHowett-MSFT added this to the Terminal v1.0 milestone Nov 21, 2019
@DHowett-MSFT DHowett-MSFT added the Priority-2 A description (P2) label Nov 21, 2019
@ihor-sviziev
Copy link

I have the same issue, workaround - press "ctrl -" one time (decrease font size), and this issue is getting fixed.

Also font size by default looks too big, for instance on Ubuntu it's usually smaller.

@phelps-matthew
Copy link

phelps-matthew commented Dec 29, 2019

Same issue. Adjusting font size does not fix, whether in json profile or ctrl +/-

@ducaale
Copy link
Author

ducaale commented Dec 30, 2019

@phelps-matthew have you tried fontSize of 10 or 14?

@phelps-matthew
Copy link

phelps-matthew commented Dec 31, 2019

@ducaale Yes I've tried a large range of sizes. There is one particular font and size combination (Delugia Nerd Font at size 10) that did not result in lines, but this would seem to be a special case.

The other fonts I desire still result in horizontal lines even at 10 pt.

@george-tsiros
Copy link

please, someone tell me i'm not weird for thinking this shouldn't be happening. We've been rendering text for more than three decades now. Certainly it's expected that we've figured it out by now? Please

@michalwidera
Copy link

I have the same issue, workaround - press "ctrl -" one time (decrease font size), and this issue is getting fixed.

Also font size by default looks too big, for instance on Ubuntu it's usually smaller.

This workaround does not help.

@PhilDim1
Copy link

Same exact issue here. Changing fonts and font size does nothing. What DOES fix this (for me) is to ensure your 'Scale and Layout' setting under Settings/Display is at 100%. Not really a solution, but perhaps someone brighter than I can fix this. This is pretty much the one issue keeping me from leaving mintty/wsltty and solely using WT.
image

@ghost ghost added the In-PR This issue has a related PR label Mar 27, 2020
@carlos-zamora carlos-zamora self-assigned this Mar 27, 2020
@ghost ghost removed the Help Wanted We encourage anyone to jump in on these. label Mar 27, 2020
@ghost ghost closed this as completed in #5149 Mar 28, 2020
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Mar 28, 2020
ghost pushed a commit that referenced this issue Mar 28, 2020
There are two antialias modes that can be set on the ID2D1RenderTarget:
- one for text/glyph drawing [1]
- one for everything else [2]
We had to configure that in the RenderTarget.

Additionally, when clipping the background color rect, we need to make
sure that's aliased too. [3]

## References
[1] ID2D1RenderTarget::SetTextAntialiasMode
    https://docs.microsoft.com/en-us/windows/win32/api/d2d1/nf-d2d1-id2d1rendertarget-settextantialiasmode
[2] ID2D1RenderTarget::SetAntialiasMode
    https://docs.microsoft.com/en-us/windows/win32/api/d2d1/nf-d2d1-id2d1rendertarget-setantialiasmode)
[3] ID2D1CommandSink::PushAxisAlignedClip
    https://docs.microsoft.com/en-us/windows/win32/api/d2d1_1/nf-d2d1_1-id2d1commandsink-pushaxisalignedclip)

## Validation
Open and interact with midnight commander with the display scaling set
to...
- 100%
- 125%
- 150%
- 175%
- 200%

Closes #3626
DHowett-MSFT pushed a commit that referenced this issue Apr 14, 2020
There are two antialias modes that can be set on the ID2D1RenderTarget:
- one for text/glyph drawing [1]
- one for everything else [2]
We had to configure that in the RenderTarget.

Additionally, when clipping the background color rect, we need to make
sure that's aliased too. [3]

## References
[1] ID2D1RenderTarget::SetTextAntialiasMode
    https://docs.microsoft.com/en-us/windows/win32/api/d2d1/nf-d2d1-id2d1rendertarget-settextantialiasmode
[2] ID2D1RenderTarget::SetAntialiasMode
    https://docs.microsoft.com/en-us/windows/win32/api/d2d1/nf-d2d1-id2d1rendertarget-setantialiasmode)
[3] ID2D1CommandSink::PushAxisAlignedClip
    https://docs.microsoft.com/en-us/windows/win32/api/d2d1_1/nf-d2d1_1-id2d1commandsink-pushaxisalignedclip)

## Validation
Open and interact with midnight commander with the display scaling set
to...
- 100%
- 125%
- 150%
- 175%
- 200%

Closes #3626
@ghost
Copy link

ghost commented Apr 22, 2020

🎉This issue was addressed in #5149, which has now been successfully released as Windows Terminal Preview v0.11.1121.0.:tada:

Handy links:

@sHAsHiLx
Copy link

Lol! Black lines goes out but font's still have line breaks. Tried to change to different fonts - it still breaks vertical lines with space lines

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.