How to specify bold font in VS Code editor?

不想你离开。 提交于 2020-06-25 07:58:51

问题


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.


回答1:


In your settings.json .vscode add this line:

"editor.fontWeight": "bold"



回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/36085443/how-to-specify-bold-font-in-vs-code-editor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!