是否可以诱使 Visual Studio 2008 使用斜体作为注释?
我非常习惯 Delphi 7 中的 IDE 设置,其中我的注释以斜体显示。
这在 VS2008 中似乎不可能。 只能选择粗体,不能选择斜体。
我可以执行某种注册表破解或字体魔法来使其正常工作吗? 我使用的字体是 Consolas,如果这有什么区别的话。
编辑:这是可能的。 请参阅此答案细节。
亚当,据我所知,您不能仅更改注释的字体名称 - 只能更改颜色和粗体。 如果我错了,请告诉我!
I'm quite used to my IDE setup in Delphi 7, where I have my comments rendered in italics.
This doesn't appear to be possible in VS2008. There's only an option for bold font, not italics.
Is there some kind of registry hack or font magic I can perform to get it to work? The font I'm using is Consolas, if that makes a difference.
Edit: This is possible. See this answer for details.
Adam, as far as I can tell, you can't change the font name for just comments - only the colour, and boldness. If I'm wrong, please tell me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
您可以通过将字体更改为 Lucida Handwriting 字体(看起来有点斜体)来伪造它,或者购买或找到免费的斜体字体。
编辑:我实际上已经检查了 Vista 上的 VS 2008 上的内置字体,并选择了 Monotype Corsiva,并将注释设置的大小提高到 12(变老了 - 眼睛不再像以前那样了)
You can kind of fake it by changing the font to something like the Lucida Handwriting font, which looks sort of italic or, buy or find a free italic only font.
Edit: I've actually gone through the built-in fonts on my VS 2008 on Vista, and chosen Monotype Corsiva, and bumped the size to 12 for my comments setting (getting old - eyes aren't what they used to be)
如果您有字体编辑器,则可以更改斜体字体以假装其为粗体。 这是一个示例。 (对于 VS 2005,但它应该可以正常工作。)
If you have a font editor, you can change an italic font to pretend it's bold. Here's an example of it. (For VS 2005, but it should work all the same.)
相关的注册表项是
“默认值是 0”。输入一些测试值后,我得到了普通、粗体和删除线文本的各种组合,但没有斜体。 对话框中也没有删除线选项,因此斜体可能具有神奇的价值。
@乔恩·林贾普< /a>:
该主题的 VS 2008 版本的注释没有斜体,只是粗体。
The pertinent registry key is
Default is 0. Putting in a few test values got me various combination of normal, bold, and strike-through text, but no italics. Strikethrough isn't an option in the dialog either, so maybe there is a magic value for italics.
@jon limjap:
The VS 2008 version of that theme doesn't italicize comments, just bold.
我推荐 Damien Guard 的 Visual Studio 的“人性化主题”< /a>. 它包括他开发的自定义字体 Envy R,它使用了一种巧妙的技巧 - 字体的粗体版本实际上是斜体,因此他的主题通过告诉 Visual Studio 将注释加粗来将注释变为斜体。
即使您不喜欢这些颜色,也只需抓住主题(或 Envy R 字体)并进行调整即可。
I recommend Damien Guard's "Humane theme" for Visual Studio. It includes a custom font he developed, Envy R, which uses a clever hack - the bold version of the font is actually italic, so his theme italicizes comments by telling Visual Studio to bold them.
Even if you don't like the colors, just grab the theme (or the Envy R font) and tweak it in.
不幸的是……不知道为什么他们不让你这样做。
但是,您可以仅更改注释的字体。 所以你可以让它变得不同,这会让它更加突出。
您甚至可以制作默认斜体的自定义版本的字体,然后将其设置为评论字体。
Unfortunately not...not sure why they don't let you do that.
You can, however, change the font for just comments. So you could make it something different which will make it stand out more.
You may even be able to make a custom version of the font you use that is by default italic and then set that as the comment font.
对于最新版本的 Visual Studio,有一些插件可以以斜体显示注释。 只需在扩展中搜索
italics
-> 管理扩展。 我用的是CommentsPlus17。For the lastest version of visual studio there are plugins that can display comments in italics. Just search for
italics
in Extensions -> Manage extensions. I used CommentsPlus17.我成功使用 FontForge 创建了带有粗体样式的 Consolas 副本(尽管这应该适用于任何字体)实际上是斜体。
这个我的其他答案有详细信息。
基本上,更改名称和 GUID,然后打开斜体变体并将其字体信息从斜体更改为粗体。
I successfully used FontForge to create a copy of Consolas (although this should work with any font) with the bold style actually being italics.
This other answer of mine has the details.
Basically, change the name and GUID, then open the italic variant and change its font info from saying italic to saying bold.
我不知道他是怎么做到的,但是 Tomas Restrepo 有一个 Visual Studio 主题,即能够将注释和字符串文字设置为斜体。
这是在 Visual Studio 2005 中进行的,但是两个版本的主题编辑看起来都没有变化,因此它可能会为您提供一些关于如何在您自己的主题上进行编辑的线索。
更新:我没有注意到他在帖子底部有一个指向 Visual Studio 2008 版本的链接。
I dunno how he did it but Tomas Restrepo has a Visual Studio theme that is able to italicize comments and string literals.
This one is in Visual Studio 2005, but the theme editing for both versions appear unchange so it might provide you with some clues as to how to do it on your own theme.
Update: I didn't notice that he had a link to a Visual Studio 2008 version at the bottom of the post.