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

Help VS users get the best font rendering #404

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Feb 10, 2021

Cascadia Code looks pretty bad in the VS editor under default settings. To help ensure developers see the font in the best rendering, this change to the README helps users realize it can look much better.

BEFORE

image

AFTER

image

@DHowett
Copy link
Member

DHowett commented Feb 10, 2021

So, this is interesting to me. Aaron went to great lengths to add hinting instructions to the font to make sure it looked good in VS, and it looks like this option disables hinting. @aaronbell, what's your opinion here?

@aaronbell
Copy link
Collaborator

Ah! One of the classic debates.

There are two schools of thought in what constitutes "good" rendering. On one side, there is the belief that letters should have sharp edges with limited smoothing (aka, BLUR). On the other side, there is the belief that the letter shapes should be preserved as much as possible, so just to smooth / blur everything. By turning off hinting, you are switching to a blur-only approach to rendering. Microsoft has long preferred the former method (and has research to back it up showing increased legibility / readability), especially on low resolution screens, and only disables hinting at larger sizes where it no longer benefits text rendering. You'll observe that this also has a side effect of making letters bolder.

All in all, I'm glad that setting this option changes the text rendering to your preference, but I do not think it correct to tell all users to select an option that turns off hinting as it will negatively impact the experience of a vast majority of users (especially those on a <150 DPI screen rendering text at normal sizes).

@DHowett My bigger question is, why the heck does VS have a text rendering option called 'ideal' that turns off hinting?

@aaronbell
Copy link
Collaborator

I recalled that I sent an email to @DHowett about Visual Studio back in Oct 2019 😄:

Visual Studio is using an antiquated ClearType rendering mode without Y-direction antialiasing. This is the reason why text appears jaggedly in app. When I swapped fonts to Fira Code, I observed the same issues, but because Fira Code is much thinner, it is slightly less noticeable. If Visual Studio updated its system to use the DWrite default subpixel rendering and allow the GASP table within the font to instruct it how to render text, then Cascadia Code would render akin to in VSCode and Windows Terminal. I also don’t think it would significantly impact the rendering of any other font used.

Amusingly, by setting font formatting to "ideal" the poor rendering code is bypassed, and instead text is blurred, which can improve the perceived rendering for some folks. However, I still believe that this can also result in a significantly worse rendering experience for others, which prevents me from recommending the 'ideal' setting.

From my email:

To resolve the jagginess, IMO the best fix for this situation is for Visual Studio to update their system to use the DirectWrite default subpixel text rendering and let the GASP table within the font instruct the system about how to render text. I don’t know how easy it would be for them, but that’s the right solution.

@AArnott
Copy link
Member Author

AArnott commented Feb 10, 2021

Interesting discussion, and TBH most went over my head. I took the screenshots and filed this PR from a standard DPI desktop screen. Now I'm looking at this issue from a HDPI Surface Book and both screenshots look bad, but especially the after version. Maybe the PNGs I pasted are being poorly enhanced for my HDPI screen. Anyway suffice it to say, "after" looked better to me on my low DPI desktop monitor.

Cascadia Code looks good in VS on this SB2 high DPI screen, without changing this setting, so evidently it perhaps only helps to switch the setting on low DPI screens.

@schuelermine
Copy link

I think this would be better if you changed the text to say "can look better to some"

@schuelermine
Copy link

As to suggest that the user might try it to see if they like it

@AArnott
Copy link
Member Author

AArnott commented Feb 16, 2021

@schuelermine Is this feedback based on the latest iteration of the PR? It already says it "may":

Cascadia Code may look better in the editor after setting this option

@schuelermine
Copy link

@schuelermine Is this feedback based on the latest iteration of the PR? It already says it "may":

Cascadia Code may look better in the editor after setting this option

@AArnott Sorry. I hadn't seen.

@cntrump
Copy link

cntrump commented Apr 23, 2021

Font Family: Cascadia Mono Light or Cascadia Mono SemiLight
Font Aliasing: antialiased
Make it looks better.

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

Successfully merging this pull request may close these issues.

5 participants