31

Is it possible to change the spacing between lines in the Visual Studio 2012 code editing area? After having worked with IntelliJ IDEA for a while, I got accustomed to a slightly larger line spacing (1.2), and I want to achieve the same effect in VS12. For comparison, the top one is IDEA with 12 pixels spacing between lines, the bottom one is VS12 with 10 pixels spacing:

enter image description here

I find the IDEA version much easier to read, even if it's just 2px difference. Does anyone know?

Lennart
  • 9,657
  • 16
  • 68
  • 84

3 Answers3

28

I've found a workaround which works pretty well, partly alread described in this comment.
You need to download and install TypeLight (free for personal use), and open the Consolas.ttf file inside. To adjust the line spacing, go to Font -> Metrics -> Advanced and change the "Line Gap" to your desire (I changed "Type Line Gap" as well, but I have no idea what this actually does). I experimented a bit with a values and found around 730 to be similar to the 12 pixels spacing in IDEA.

To distinguish the modified font from the regular Consolas, I suggest changing the name of the font under Font -> Names (to "Consolas Spaced" or something). Save the font, double-click the file and choose "Install" from the preview dialog. Then (re)start Visual Studio, choose your modified font and you're done.

Community
  • 1
  • 1
Lennart
  • 9,657
  • 16
  • 68
  • 84
  • 1
    As stated here [http://logotalks.com/2011/08/23/advanced-font-metrics-in-fontlab/](http://logotalks.com/2011/08/23/advanced-font-metrics-in-fontlab/), **Line Gap** “is used by the Mac OS to compensate Ascender and Descender values and calculate the correct distance between baselines of the text” and **Typo Line Gap** “is a distance between bottom line of the upper line of text and top line of the lowerline of text” – grizzly Nov 22 '15 at 15:23
  • +1. Note that it will change the font line spacing for not just Visual Studio but also any other application using that font. – Dio Phung Jun 15 '17 at 23:08
3

As of Visual Studio 2019 (16.10.0) it is now possible to change the line spacing directly in the options under Text Editor => General:

enter image description here

Lennart
  • 9,657
  • 16
  • 68
  • 84
2

Can't change directly in Visual studio.
--> BUT You CAN change line height of font, the font you're using.
Step 1: install Fontforge.
Step 2: Open Fontforge after install finished, go to:
Element->Font Info ->OS2 -> Unit.
Change 4 value: Down win, up win, top N, down horizontal by multiplied by the desired ratio. Sample: ratio 1.5 or 2 ..etc...
(it means: if default 800, you multiple with ratio 1.5 --> result is 1200, you change 800 -->1200)
--> click OK to save setting.
Step 3: Go to File -> Generate font --> Generate with ttf format.
Step 4: Install the font just created and change font in Visual Studio.

David Glickman
  • 713
  • 1
  • 11
  • 18
O Thạnh Ldt
  • 1,103
  • 10
  • 11