Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify bold font in VS Code editor?

How to specify a bold font in VS Code's settings.json? For example, I have Envy Code R and Envy Code R Bold (exact names shown in windows' font viewer) installed on my windows machine, and while

"editor.fontFamily": "Envy Code R"

setting works fine,

"editor.fontFamily": "Envy Code R Bold"

doesn't work (a fallback font is used instead).

Is that possible to do at all? There are no any other font settings like fontWeight or fontStyle. I also tried specifying other fonts with bold variants to no avail. VS Code 0.10.11 here.

like image 559
sunny moon Avatar asked Mar 18 '16 13:03

sunny moon


People also ask

How do I make my font bold?

Type the keyboard shortcut: CTRL+B.


4 Answers

In your settings.json .vscode add this line:

"editor.fontWeight": "bold"
like image 78
Lucas925 Avatar answered Oct 17 '22 09:10

Lucas925


This is a bug with Atom: https://github.com/atom/atom/issues/3790

A workaround is to strip spaces and add a hyphen between the font name and the weight.

Envy Code R Bold == EnvyCodeR-Bold

ref: https://github.com/Microsoft/vscode/issues/381#issuecomment-163356103

like image 45
tripdubroot Avatar answered Oct 17 '22 09:10

tripdubroot


Here is what I did trying to solve the same issue on a Mac. I installed the font on my Mac the usual way:

  • double-click on the .ttf file and click on Install Font

The font had some variants, I wanted to use one of them on vs-code.

When you install the font on your Mac an application called Font Book pops up (see screenshot).

  • Click on the i icon highlighted in the screenshot, it will give you the information of the Postscript name of the font.
  • copy-paste this value (the Postscript name value) into vs-code's settings -> Editor: Font Family as your first item in the list.

Mac Font Book Application

Result:

Result of adding font in vs-code

like image 13
Juan Castano Avatar answered Oct 17 '22 10:10

Juan Castano


Alternative way:

On MAC go to Code -> Preferences -> Settings or press shortcut CMD + ,

In search bar just write font and you should find:

Editor: Font Weight

And from there you can choose your font weight from 100 to 900

like image 6
Freestyle09 Avatar answered Oct 17 '22 09:10

Freestyle09