3

I'm trying to make VS Code editor to look exactly like Visual Studio. I made sure the font settings are exactly the same, however text still renders differently in VS Code (it seems "lighter"). Is there any way to fix this issue?

In the image below the top text is copied from Visual Studio while the bottom one is copied from VS code. I know the difference is subtle but is still pretty noticeable.

enter image description here

Rodion Degtyar
  • 238
  • 2
  • 7
  • I noticed that VSCode renders the fonts differently as well — different from a lot of other software actually. If it does, it is probably some newer rendering software they are using, to achieve a more contemporary look. Ill see what I can find out. – JΛYDΞV Jun 23 '21 at 18:48
  • There is a Visual Studio 2017 Light theme on the marketplace that will get you very very close to what you want – Timothy G. Jun 23 '21 at 19:00

1 Answers1

4

Font rendering in VSCode has been a reoccurring issue throughout a good portion of the editors life time. Font rendering, especially in portable GUI's, is affected by several different layers, for example:

  • Your Graphics Card can affect the way font is rendered (you can try adjusting the graphic cards settings manually).

  • Your Monitor, obviously, affects rendering. In fact your monitor has a huge impact. (Try playing with your Monitor's Settings)

  • The color settings that are offered by your OS may have an impact (often times the color settings are the same as the graphic card settings though. Which means you can just use your OS's GUI to adjust your cards settings in some cases (Not on Ubuntu though))_


Somethings are out of your control, like:

  • VSCode, it is written using Electron v6. Not only does Electron impact font rendering, but when VSCode switched it Version 6 a lot of people reported a decrease in the editors font rendering quality.

  • VSCode also implements Anti-Aliasing tools, but as far as I can tell, they auto configure, so you have no control over this. These tools are likely to be one of the biggest causes to the difference in rendering you see, between VS IDE & VS CODE. There is a tool however that may give you some control over the Visual Studio side of rendering that I share a link to below. And just as an FYI, the Anti-Aliasing that VSCode uses is called Sub-pixel Rendering, which is something that Visual Studio doesn't implement as far as I can tell.



The Area You Have the Most Control in:

There is ONE tool/thing that you have 100% control over, that also greatly affects font-rendering, and that is the font that you decide to use. When choosing a font, you have the choice of equipping an OTF, or a TTF. In my personal experience, OTF's render better 90% of the time. The difference is in how they are created.

Links above are the same


Fonts use something called font-hinting

Font hinting. Essentially font-hinting is a list of instructions that dynamically changes the way a font is rendered, by using the rasterized grid background as a parameter. adjust the display of an outline font so that it lines up with a rasterized grid. Choosing a quality font equipped with good hinting is critical for non-blurry readable text.

Many people choose font because like the way they look, or the italic version of the font they use is popular. When choosing a font, it is extremely important to choose, not the coolest one, but the one that renders with the highest quality, and is the easiest for you to read.

Well Rendering Fonts:

Not only are their fonts that render well, with ligature support, but the best rendering fonts are always free IMO. Bellow are Fonts that use font hinting and have top notch rendering abilities.

  1. JetBrains Mono (JetBrain's Font & My Personal Favorite)
  2. Cascadia Code (Microsoft's Programming Font from 2019)
  3. Fira Code (Not that old, but not that new either. Is loved by many.)
  4. Fira Mono (No Ligatures, Different Font than Fira Code)
  5. Consolas (A classic)
  6. Menlo (Another Classic)

The top 4 are at the top of the list because they receive updates ever few months. I don't think Menlo & Consolas receive regular updates, but they aren't left forgotten either, the are updated every year or two.



To finish with as solid of an answer as I can provide:

_"Getting VSCode to render like the Visual Studio IDE, is not something that you will probably get, with 100% satisfaction, getting an exact match with all of the different factors is just an extremely and possibly impossible thing to due. You can probably make the way the two pieces of software render, more a like, not in functionality, but in looks. It would probably help a great deal to make sure that everything that affects rendering is up to date, editor, IDE, fonts, tools, ect... From their you can try different versions, and see if maybe an older version of VSCode rendered in a way that is preferable to you. You should also play with your monitors settings. I have found that I can accomplish a great deal just through the buttons under the face of my monitor. Check Visual Studio for any rendering settings it might have, VSCode doesn't have much available, but maybe Visual Studio IDE does (I haven't used the IDE in 5 years so IDK if it does).



On a final note:

Their is one tool that could help you, I haven't used it, because it isn't for VSCode, it's for Visual Studio, but it might give you more control than you have now. The tool is called..."_



JΛYDΞV
  • 8,532
  • 3
  • 51
  • 77