有什么方法可以更改 VSCode 中仅注释代码的字体系列? [英] Any way to change the font family of only commented code in VSCode?

查看:17
本文介绍了有什么方法可以更改 VSCode 中仅注释代码的字体系列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用户设置中遇到过这种情况 "editor.fontFamily": "Consolas, 'Courier New', monospace", 但是有没有办法只更改评论的字体?我在其他编辑器中看到人们有半草书评论,我希望能够复制类似的内容.

I've come across this in user settings "editor.fontFamily": "Consolas, 'Courier New', monospace", but is there any way to change only the font of comments? I've seen people have semi cursive comments in other editors and I'd like to be able to replicate something similar.

推荐答案

您可以使用 editor.tokenColorCustomizations 设置更改字体 style:

You can change the font style with the editor.tokenColorCustomizations setting:

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": "comment",
            "settings": {
                "fontStyle": "italic"
            }
        }
    ]
}

我认为现在没有办法改变字体系列.该设置只允许自定义 fontStyleforeground(文本颜色).不过,有一个开放的功能请求需要添加对它的支持:

I don't think there's a way to change the font family right now. The setting only allows customizing fontStyle and foreground (text color). There's an open feature request for adding support for it though:

支持 textMateRules 中的 fontName (#36512)

这篇关于有什么方法可以更改 VSCode 中仅注释代码的字体系列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆