question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line height and font size are too large by default

See original GitHub issue
  • VSCode Version: 1.10.2
  • OS Version: win10 x64 My monitor native resolution is 1920x1200

When opening any file in VSCode, it shows only 56 lines at any time. I feel that the current line height and font size are too much by default.

For reference:

Sublime Text 3: 71 lines 
 Notepad++ 6.9: 65 lines
      gVim 7.4: 66 lines 
  UltraEdit 23: 67 lines

In contrast, Atom 1.15 displays even less: 49 lines


By default VSCode has in its settings:

"editor.fontSize":  14,    // Controls the font size in pixels.
"editor.lineHeight": 0     // Controls the line height. Use 0 to compute the lineHeight from the fontSize.

If I set them to 13 and 15 respectively then the visible lines area becomes on par with the other editors: 71 lines.


Also, (while using the default Dark+ theme and the default setting "editor.fontFamily": "Consolas, 'Courier New', monospace") with my suggested settings, 13pt Consolas I think it is appears a bit boldish. Changing the value"editor.fontWeight": "normal" to anything below 400 doesn’t make a difference. (related issue: #381) That’s why I believe that, in conjunction with the above two suggested changes, it would be even better to switch to a slightly different font that would support setting fontWeight below 400 e.g. something like “Consolas Light” -I know that this font currently doesn’t exit- )


So, my suggestion is to change the default values of these settings to 13 and 15 respectively, plus lower the fontWeight value somehow


Here is VSCode with its default settings: screenshot 682

And here is comparison of VSCode with my suggested settings vs Sublime Text 3:

screenshot 678 screenshot 678b

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:6
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hi-haicommented, May 8, 2022

Consolas looks much better on JetBrain’s IDE-s and in Sublime Text. The same font size. The font weight on VS Code is messed up because of the underlying Electron code, which is mostly being developed outside of MS. GitHub’s own Atom editor suffers the same problem.

@regs01 I agree that the font size and height is a matter of taste. As the editor is configurable, everyone can “tune” it to suit his/her preferences 😃

Can’t agree more. However even I set font size to 13, the margin between lines are still larger than sublime text. Looks pretty strange and difficult to read than ST.

This is Sublime Text Screen Shot 2022-05-07 at 20 19 46

This is VS code: Screen Shot 2022-05-07 at 20 20 21

0reactions
cpsauercommented, May 13, 2021

Hey fellow folks interested in font/line height configuration in VSCode: Any chance we could get your upvote over on #115960?

We’re trying to get line height expressible as a ratio of font size, as it is in other editors and in other parts of VSCode, and we could really use your help. We’ve got just a few more days to get those last few votes! It’d make it much easier to dynamically resize fonts!

Read more comments on GitHub >

github_iconTop Results From Across the Web

line-height - CSS: Cascading Style Sheets - MDN Web Docs
The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text.
Read more >
You need to fix your `line-height` - Kevin Powell
How to pick a good, default line-height for your site; Situatons where you need to ... It starts to cause problems at larger...
Read more >
Choosing a suitable line height – Fonts Knowledge
The smaller the type, the more generous we should be with our line height values. When text is set large, the space between...
Read more >
Size Matters: Balancing Line Length And Font Size In ...
A line height that is too tight could undermine horizontal eye movement and encourage scanning down the left edge. It could also force...
Read more >
Line height default value if font size is 100% - Stack Overflow
Actually default line-height is 1.3EM (130%) because with smalled line height characters that go under and above the line would collide in multi ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found