What font is used in the Visual Studio code editor and how to change fonts?

I tried the Visual Studio Code Editor ( https://code.visualstudio.com/ ), which was recently announced during the build. I tried this on Windows and Ubuntu. I see that the default font for Visual Studio Code Editor is not the consoles that my code editors prefer.

So, what is the default font for the Visual Studio Code Editor in all environments (Ubuntu, MAC OS, and windows)? And how can I change it?

+151
visual-studio-code
Apr 30 '15 at 5:55
source share
9 answers

Go to " Preferences >" User Settings . (Alternatively, Ctrl + , / Cmd + , on macOS)

Then you can enter any parameters you want to override into the JSON object. User settings for each user. You can also configure workspace settings that apply to the project you are currently working on.

Here is an example:

 // Controls the font family. "editor.fontFamily": "Consolas", // Controls the font size. "editor.fontSize": 13 



Useful links:

+166
Apr 30 '15 at 7:14
source share

In the default settings, VS Code uses the following fonts (14 pt) in descending order:

  • Monaco
  • Menlo
  • Consolas
  • "Droid Sans Mono"
  • "Inconsolata"
  • "Courier New"
  • monospace (standby)



How to check: VS Code works in a browser. In the first version, you can press F12 to open the Developer Tools. By checking the DOM, you can find the one containing a few s that make up this line of code. By checking one of these intervals, you can see that the font family is just the list above.

relevant areas

+94
Jun 02 '15 at 19:57
source share

In VSCode, if "editor.fontFamily": "" empty, the font size will NOT work. Install the font family to resize.

"editor.fontFamily": "Verdana", or "editor.fontFamily": "Monaco",

Indeed, use any font family that you like.

Then "editor.fontSize": 16, should work.

+19
Jun 04 '15 at 20:31
source share

In my 8.1 window, by default the VS font of the VS font is Consolas, but you can easily change the font in the menu File-> Preferences-> User Preferences. The setup.json file will be opened along with the default settings file, from where you can get the syntax and names for the parameter properties and set your own in settings.json. enter image description here

+14
Apr 30 '15 at 6:54
source share

The default fonts vary on Windows, Mac, and Linux. Starting with VSCode 1.15.1, the default font settings can be found in the source code :

 const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \'Courier New\', monospace'; const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospace'; const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', \'Courier New\', monospace, \'Droid Sans Fallback\''; 
+13
Aug 29 '17 at 5:49 on
source share

On Windows, the default settings are as follows (I never installed Monaco or Menlo)

 { "editor.fontFamily": "Consolas", "editor.fontSize": 14, "editor.lineHeight": 19 } 

The fontSize settings to 12 and lineHeight to 16 bring Visual Studio closer to Consolas with a size of 10pt. I could not get an exact match (the VS Code font is a little bolder), but close enough.

+10
Apr 13 '16 at 19:17
source share

Another way to determine the default font is to start typing "editor.fontFamily" in the settings and see what auto-fill offers. On Mac, this shows by default:

"editor.fontFamily": "Menlo, Monaco, 'Courier New', monospace",

which confirms what Andy Lee says above.

+2
Jun 01 '18 at 16:45
source share

Open VScode.

Press ctrl,.

Parameter "editor.fontFamily" .

On Linux, to get a list of fonts (and their names that you should use), run this in a different shell:

 fc-list | awk '{$1=""}1' | cut -d: -f1 | sort| uniq 

You can specify a list of fonts to have spare values ​​in case of a missing font.

0
Oct 13 '18 at 4:54
source share

Go to Tools-> Options in the main window. Under the Environment container, you can see fonts and colors. You can choose the font and color that you want.

0
Jul 07 '19 at 16:52
source share



All Articles