How to modify the style property of a font on Windows?

前端 未结 2 1260
孤街浪徒
孤街浪徒 2020-12-31 08:08

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

If the long question t

2条回答
  •  礼貌的吻别
    2020-12-31 08:11

    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!

提交回复
热议问题