Which font is used in Visual Studio Code Editor and how to change fonts?
I tried Visual Studio Code editor(https://code.visualstudio.com/) which is recently announced at build. I tried it on Windows and Ubuntu. I can see that default font of Visual Studio Code Editor is not consolas which prefer on my code editors.
So which is default font of Visual Studio Code Editor in All the environments(Ubuntu, MAC OS and windows)? And how can I change it?
Go to Preferences
> User Settings
. (Alternatively, Ctrl + , / Cmd + , on macOS)
Then you can type inside the JSON object any settings you want to override. User settings are per user. You can also configure workspace settings, which are for the project that you are currently working on.
Here's an example:
// Controls the font family.
"editor.fontFamily": "Consolas",
// Controls the font size.
"editor.fontSize": 13
Useful links:
- Default Settings
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 (fallback)
How to verify: VS Code runs in a browser. In the first version, you could hit F12 to open the Developer Tools. Inspecting the DOM, you can find a containing several s that make up that line of code. Inspecting one of those spans, you can see that font-family is just the list above.
The default fonts are different across Windows, Mac, and Linux. As of 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\'';
In VSCode if "editor.fontFamily": ""
is blank, the font size will NOT work. Set a font family to change the size.
"editor.fontFamily": "Verdana",
or
"editor.fontFamily": "Monaco",
Really, use whatever font family you like.
Then "editor.fontSize": 16,
should work.