[英]How to specify bold font in VS Code editor?
How to specify a bold font in VS Code's settings.json
?如何在 VS Code 的
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例如,我在我的 Windows 机器上安装了
Envy Code R
和Envy Code R Bold
(在 Windows 的字体查看器中显示的确切名称),而
"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
.没有任何其他字体设置,如
fontWeight
或fontStyle
。 I also tried specifying other fonts with bold variants to no avail.我也尝试用粗体指定其他字体无济于事。 VS Code
0.10.11
here. VS Code
0.10.11
在这里。
在您的settings.json .vscode中添加以下行:
"editor.fontWeight": "bold"
This is a bug with Atom: https://github.com/atom/atom/issues/3790 这是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 参考: https : //github.com/Microsoft/vscode/issues/381#issuecomment-163356103
Here is what I did trying to solve the same issue on a Mac.这是我尝试在 Mac 上解决相同问题时所做的工作。 I installed the font on my Mac the usual way:
我以通常的方式在 Mac 上安装了字体:
.ttf
file and click on Install Font
.ttf
文件,然后单击Install Font
The font had some variants, I wanted to use one of them on vs-code.字体有一些变体,我想在 vs-code 上使用其中之一。
When you install the font on your Mac an application called Font Book
pops up (see screenshot).当您在 Mac 上安装字体时,会弹出一个名为
Font Book
的应用程序(参见屏幕截图)。
i
icon highlighted in the screenshot, it will give you the information of the Postscript name
of the font.i
图标,它将为您提供字体Postscript name
的信息。Postscript name
value) into vs-code's settings -> Editor: Font Family
as your first item in the list.Postscript name
值)复制粘贴到 vs-code 的设置 -> Editor: Font Family
作为列表中的第一项。 Result:结果:
Alternative way: 替代方式:
On MAC go to Code -> Preferences -> Settings or press shortcut CMD + , 在MAC上转到代码 - > 首选项 - > 设置或按快捷键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 从那里你可以选择从100到900的字体重量
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.