Fixing Italic in Visual Studio Code

Cobalt2 italicizes all comment text, and it can be fixed

Hyunbin
Apr 14, 2022

VS Code themes can italicize certain text. For example, Cobalt2 italicizes all comment text. One exception is the | symbol in macOS environment, which greatly improves table legibility. (Yes, I use markdown tables in comments.)

In the comments, the ‘|’ symbol is straight on macOS and tilted on Windows

The default font-family setting in VS Code for Windows is as follows. When the Cobalt2 Theme is rendered with Consolas, | is tilted in the comments.

Consolas, 'Courier New', monospace

Changing the font-family to D2Coding did not fix the issue. Every font other than Courier New seemed to render tilted | symbol on Windows.

Solution

Resetting font style using this setting does fix the problem. It can also be applied in the user level by adding it to the settings.json in the AppData.

settings.json containing user level preferences in Windows

However, I just decided to use a different theme. GitHub Theme works!

GitHub Dark color theme applied to VS Code in Windows

--

--

Hyunbin

Node.js and web developer using TypeScript. Undergraduate in Seoul National University.