2

In Windows, I always use 125% system DPI. Visual Studio ever since 2013, has not liked this. The typical font (Consolas) is rendered slightly "too short" vertically, it's essentially missing a row of pixels in the middle somewhere.

You can see it in this screenshot comparison, pay special attention to the letter "e":

Screenshot comparison of incorrect and correct rendering

There used to be a thread on Microsoft Connect forums about this, and there was a simple registry tweak that someone found, to fix it. Unfortunately, that site has since been dismantled, and the thread is gone. It used to be at this location: https://connect.microsoft.com/VisualStudio/feedback/details/800283/change-of-consolas-font-rendering-in-vs2013

There are other people too, who are still running into the issue today on every reinstall of Visual Studio, and they unfortunately want to look at that thread and see the registry tweak, but cannot: https://developercommunity.visualstudio.com/content/problem/67307/editor-font-is-squished-vertically-with-consolas-1.html and https://developercommunity.visualstudio.com/content/problem/2581/consolas-10-with-a-system-dpi-of-120-is-not-render.html

What is the registry tweak to fix this issue?

1 Answer 1

0

The registry value to fix this issue, is at this path, at least for Visual Studio 14.0 and earlier:

Computer\HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\Text Editor\

In that location, we need to add key name "RoundFontSizes" with type "REG_DWORD" and value 0.

Unfortunately, in later versions of Visual Studio, Microsoft relies less on the Windows Registry, and instead uses a private registry file somewhere in %APPDATA%. But we can still edit this and add the value we need!

On my computer, this private registry file is at:

C:\Users\mynamehere\AppData\Local\Microsoft\VisualStudio\16.0_827ec51e\privateregistry.bin

We can still use windows Registry Editor! In Registry Editor, highlight "HKEY_USERS" and go to File -> Load Hive. Then find the privateregistry.bin. You'll be asked for a name, name it anything, like "VS2019PreviewConfig".

Then, navigate into it and find the previously mentioend "...\Text Editor\" location. There are probably no settings here, but that's ok. Add a new DWORD value "RoundFontSizes" and leave it at value 0.

Then, in the navigation pane, highlight the registry you loaded by whatever name you used (e.g. VS2019PreviewConfig for me) and then use File -> Unload Hive.

Then start up visual studio again to hopefully see the fixed text!

1
  • If I remember correctly, it's ok to answer your own question, right? =] I will accept this answer in 2 days when I am allowed.
    – Eric K
    May 13, 2019 at 23:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .