microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
94.99k stars 8.22k forks source link

Minor artifacts on characters when using custom display scaling (like 130%) #4591

Open vasily-codefresh opened 4 years ago

vasily-codefresh commented 4 years ago

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Windows Terminal version (if applicable):

Any other software?

Microsoft Windows NT 10.0.18362.0
Windows Terminal (Preview) Version: 0.9.433.0

Steps to reproduce

Expected behavior

fonts are scaled together with the rest of the system

Actual behavior

fonts are scaled weirdly with wrong size and visible artefacts

compare those screenshots.

  1. regular Windows console using Consolas 16pt. everything's fine here
  1. Windows Terminal using Consolas 16pt. somehow this 16pt is much larger
  1. Windows Terminal using Consolas 11 pt (almost matches size in Windows console). notice broken fonts

font rendering has visible artifacts on almost all letters, very notable on щ, й, з, б, р, ч and even English a and e. the screenshot is a lossless PNG, that's how Windows Terminal display those in real life.

j4james commented 4 years ago

Note that the old console measures font sizes in pixels, not points (see issue #142). So that's why the sizes are so different.

I'm not sure about the font rendering artifacts - even zoomed in they look almost identical to me - but I'm probably just not a good judge of quality. Also there are definitely jpeg rendering artifacts. Your original image may have been a lossless PNG, but the github-hosted images are JPEG.

vasily-codefresh commented 4 years ago

@j4james good catch. please see original uncompressed PNG

there a lot of artifacts. for example see the second line, first о in Корпорация or the first a in aka.ms on next line.

j4james commented 4 years ago

The new image still seems to be a jpeg, but now that I know where to look, I can definitely see what you mean about the artifacts. I wonder if it might be related to your graphics driver. I believe the old console uses GDI for rendering, while the new Windows Terminal uses DirectX, which would explain why you only see the issue in WT. That's just a wild guess though.

vasily-codefresh commented 4 years ago

dxgiag sees no problems.

you can try to reproduce this by setting custom scaling on Windows at 130% and rebooting.

DHowett-MSFT commented 4 years ago

I believe this is a /dupe of #4367. Agree?

ghost commented 4 years ago

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

j4james commented 4 years ago

@DHowett-MSFT Just to be clear, it's not a problem with the character heights - there are little rendering glitches to the right of some of the letters. I don't know if that makes it different from #4367 or not.

If you zoom in, it becomes more obvious where the problems are. For example, look at the little bump on the side of the second 'o' in 'Corporation' compared to the first 'o'.

image

I haven't been able to reproduce it myself though.

DHowett-MSFT commented 4 years ago

huh

zadjii-msft commented 4 years ago

I definitely see a repro of this with 130% scaling, font size 9, grayscale or cleartype AA, "Fira Code" as my font. Also repros at size 9 with "Hack" and "Cascadia Code"

When it repros for me, it's happening in the following columns:

Microsoft Windows [Version 10.0.19604.1002]
(c) 2020 Microsoft Corporation. All rights reserved.

migrie@MIGRIE-SLAPTOP>oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooo
      ^             ^             ^               
      7             21            35

It's not always a left-right artifact though. Sometimes it definitely does something weird in the y direction, making some parts of characters look too wide. It kinda looks like an anti-aliasing artifact

zadjii-msft commented 4 years ago

Okay, I'm punting this till the next release, because it's a fairly uncommon scenario, that peculiarly doesn't repro with other DPI scalings at the standard 100%/125%/150% (etc.) scalings.

image

I tried creating a branch where I used a float to store our scaling and DPI. This did seem to make the problem far less prevalent, but didn't entirely resolve the issue. If you look at the above screenshot, you'll see the artifact will be visible on all characters in the column at a specific pixel distance from the left of the window. In this screenshot, it's the right side of all the "WOQ" column of characters.

If you decrease the font size, the artifact continues to occur at that specific pixel column, not that character column.

Maybe there's somewhere else in the DX renderer that we're doing more int math instead of float math?

Note that it also repros with grayscale AA: image

LinoBarreca commented 3 years ago

Until I had this problem i underestimated the importance of a clean font rendering. The problem is so bad on my side that I can not concentrate when using the terminal...and i swear i don't suffer from OCD. The glitches are not minor. The lines are deformed both in height and width. For sample pictures look at #8533 (sorry for the duplicate, i searched for it and i found only a bug in which they were referring to a problem with intel cards and acceleration but that wasn't my case)

adhadse commented 3 years ago

Found same issue happening on Windows Terminal window for Ubuntu at font 12, 'JetBrains Mono' on Version: 1.9.1942.0.

My screen scaling is set to 110%. Any type of anti-aliasing other than default "Grayscale" gets even worse.

Check the ticked text and compare that to usual text:

kXborg commented 2 years ago

I don't know how you guys are closing the issue. I don't see any proper fixes. Setting display scaling back to default 100% does improve the rendering a little but this too is not very good. Take a look at the screenshot below. Left side is of Terminal and Right side is of Default Powershell. Both are using same text and scale. Please provide fixes. The texts are not beautiful at all (in Terminal). Terminal-Powershell

kXborg commented 2 years ago

This is the zoomed view. Zooming out makes me feel like I am using a 640x480 pixel display.

zadjii-msft commented 2 years ago

I don't know how you guys are closing the issue. I don't see any proper fixes.

We're not? I'm simply combining threads reporting the same issue to a single thread, for easy tracking. Custom display scaling sizes, like 130%, or 118% cause a LOT of visual artifacts, that we're using this thread to track resolving.

@kXborg From the settings you sent me in #11679, you have text antialiasing turned off:

{
    "altGrAliasing": true,
    "antialiasingMode": "aliased",
    "colorScheme": "Campbell Powershell",
    "commandline": "powershell.exe",
    "font": 
    {
        "face": "Courier New"
    },
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "hidden": false,
    "name": "Windows PowerShell"
},

Getting rid of the "antialiasingMode": "aliased", will probably help you.

kXborg commented 2 years ago

@zadjii-msft,
Hi, it fixed the issue. Thanks a lot, Mike

michaelbing3shape commented 2 years ago

I would like to vote for this to be fixed. It looks awful even with grayscale AA. Regular PowerShell looks fine. 110% scaling. I don't have problems with any other apps.

image image