如何修改Windows上字体的样式属性? [英] How to modify the style property of a font on Windows?

查看:775

好的,我已经成功地使用FontForge来创建一个Consolas的副本(尽管这应该与任何字体一起工作),而大胆的样式实际上是斜体。



以下是我遵循的步骤:


  • 安装 FontForge 。在linux上执行这个比在windows / cygwin上执行起来容易很多。我使用了一个Ubuntu虚拟机(sudo apt-get install fontforge)。
    在FontForge中打开Consola.ttf(正常样式字体)。
  • 选择元素 - >字体信息。

  • 更改人类的字体名称,姓氏和名称,全部改为相同的东西。我使用了'ConsolasVS'。

  • 点击确定。单击是让FontForge为字体生成一个新的GUID。
  • 选择File - > Generate Fonts。确保你已经选择了TrueType。取消选中保存前验证。点击保存。

  • 现在在FontForge中打开Consolai.ttf(斜体样式字体)。
  • 返回Element - > Font Info。 li>
  • 改变字体名称,像之前一样,以及它当前所说的斜体,改为粗体。

  • 转到OS / 2选项卡,请将字体重量更改为700 Bold。

  • 转到Mac选项卡,将样式设置为粗体。再次生成一个新的GUID。
  • 文件 - >生成字体,像以前一样。


    <将你的两个新的ttf文件复制到你的\ Windows \FONTS\文件夹中。

    你现在可以在VS2008中用Consolas做出很好的斜体评论。万岁!


    Note that this question continues from Is it possible to coax Visual Studio 2008 into using italics for comments?

    If the long question title got you, here's the problem:

    How to convert the style property of the Consolas Italic font to Bold without actually modifying any of its actual glyphs? That is, we want the font to be still the same (i.e., Italic) we merely want the OS to believe that it's now a Bold font.

    Please just don't mention the name of a tool (Ex: fontforge), but describe the steps to achieve this or point to such a description.

    解决方案

    Alright, I've successfully used FontForge to create a copy of Consolas (although this should work with any font) with the bold style actually being italics.

    These are the steps that I followed:

    • Install FontForge. It's a lot easier to do this on linux than on windows/cygwin. I used a Ubuntu VM ("sudo apt-get install fontforge").
    • Open Consola.ttf (the "normal" style font) in FontForge.
    • Select Element -> Font Info.
    • Change the Fontname, Family Name, and Name for Humans, all to the same thing. I used 'ConsolasVS'.
    • Click Ok. Click 'Yes' to let FontForge generate a new GUID for the font.
    • Select File -> Generate Fonts. Make sure you've got "TrueType" selected. Uncheck "Validate before saving". Click Save.
    • Now open Consolai.ttf (the italic style font) in FontForge.
    • Go back to Element -> Font Info.
    • Change the Font names as before, and where it currently says "Italic", change that to "Bold".
    • Go to the OS/2 tab, change the font weight to "700 Bold".
    • Go to the Mac tab, change the style set to Bold.
    • Click Ok. Allow a new GUID to be generated again.
    • File -> Generate Fonts, as before.

    Copy your two new ttf files into your \Windows\FONTS\ folder.

    You can now have nice italic comments with Consolas in VS2008. Hooray!

    这篇关于如何修改Windows上字体的样式属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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