Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preference to customize vertical line spacing #3498

Closed
Tracked by #1790
Spongman opened this issue Nov 9, 2019 · 66 comments · Fixed by #14255
Closed
Tracked by #1790

Add preference to customize vertical line spacing #3498

Spongman opened this issue Nov 9, 2019 · 66 comments · Fixed by #14255
Assignees
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-Settings Issues related to settings and customizability, for console or terminal Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

Comments

@Spongman
Copy link

Spongman commented Nov 9, 2019

the space between lines is way too large.

here's a comparison of the same block of text in terminal (top-left) and windows 10 command prompt (both bottom and right). the font is 'Lucida Console' in both programs.

the block on the bottom shows that the fonts are the same size (the width is the same).

the block on the right shows that the Terminal rendering is nearly 40% larger (blue arrow) than the Command Prompt rendering. That's 40% less text i can read without scrolling.

at the very least there needs to be an option to change the leading (that scales properly), although i'd recommend making it look like Command Prompt by default.

image

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 9, 2019
@mdtauk
Copy link

mdtauk commented Nov 9, 2019

I think the top left line spacing is very readable, and preferable.

As long as the box and block drawing characters line up properly without gaps, then that is good.


Now if you are saying there should be an option to adjust the line spacing - again as long as box drawing characters line up properly - then sure add line spacing as an option.

@zadjii-msft
Copy link
Member

Thanks for the suggestion! I could have sworn there was already an issue for this, but it looks like it was only ever mentioned as a part of #1790 (and other threads), but never tracked individually. This is now the thread for configurable line height / spacing. Thanks!

@zadjii-msft zadjii-msft added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-Settings Issues related to settings and customizability, for console or terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Nov 11, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Nov 11, 2019
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Nov 11, 2019
@miniksa miniksa removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Nov 11, 2019
@miniksa miniksa changed the title line spacing is too large Add preference to customize vertical line spacing Nov 11, 2019
@Rican7
Copy link

Rican7 commented Jan 15, 2020

Just wanted to hop in here and mention that while the config/preference would be nice, @Spongman might be seeing the effect of #455 (specifically #2779) happening here, if they're running with any "Display Scaling" in Windows.

@Spongman
Copy link
Author

nope, no display scaling going on.

just too much line spacing. you can see it in all the screenshots, too. so it's not just me.

@Rican7
Copy link

Rican7 commented Jan 22, 2020

Ah, ok. Fair.

I just figured it might have something to do with that. But yea, I agree that there's too much line spacing, regardless of display scaling settings.

@Techtonictools
Copy link

Techtonictools commented Feb 1, 2020

It is exciting to see MS create a new terminal. Great work, I appreciate it.

+1 for the option to reduce spacing. Not a fan of reading double spaced lines and prefer smaller font too. Much more data can be presented in the given space.

Linux and Mac don't have such wide spacing and large fonts by default.

@Spongman
Copy link
Author

Spongman commented Feb 5, 2020

Linux and Mac don't have such wide spacing and large fonts by default.

btw: you can use CTRL+<Mouse Wheel> to change the font size.

@ethanherbertson

This comment has been minimized.

@DHowett-MSFT

This comment has been minimized.

@Inversion-des

This comment has been minimized.

@markwu
Copy link

markwu commented Sep 3, 2020

I prefer taller, actually I want more taller. An option for line height (line spacing) is really good.

@jonhue
Copy link

jonhue commented Nov 9, 2020

@zadjii-msft is an option to configure the "lineHeight" still something we'd be interested in including? If so, I'd be interested in having a go at implementing this :)

@mdtauk
Copy link

mdtauk commented Nov 9, 2020

@zadjii-msft is an option to configure the "lineHeight" still something we'd be interested in including? If so, I'd be interested in having a go at implementing this :)

Does Windows Terminal draw it's own Box Drawing characters, I know it was proposed #5897 #455

If so, many of these will need to be adjusted to retain seamless lines and borders. But Full Block heights, should probably stay aligned to the text lines.

@Diablo-D3
Copy link

Throwing this in here, and I haven't seen anyone else make this argument: getting consistent cell width and height is hard to do across programs (different font engines, different interpretations of width and height, round up or to nearest, etc): just do what every other good terminal does, allow an signed offset to the calculation.

@rewrking
Copy link

Bumping to say I was surprised as a user to not find this setting. it seems completely dependent on the font you're using right now.

@DHowett
Copy link
Member

DHowett commented Sep 17, 2022

Well, good news! We're significantly moving up the timeframe for this feature thanks to the new text rendering engine :)

@lhecker
Copy link
Member

lhecker commented Oct 11, 2022

I've implemented a version of line height customization in https://github.com/microsoft/terminal/tree/dev/lhecker/3498-line-heights. I'm proposing the following:

  1. Instead of just allowing line height adjustments I think we should also allow cell width adjustments.
  2. The size adjustment can be specified as /^[+-]?\d+(?:\.\d+)?(?:%|px|pt)?$/, or in other words:
    • Sizes are mostly specified the same way line-height works in CSS. For instance:
      • 1.23 sets the size to 123% of the font size.
      • 123% works identical to 1.23
      • 1.23ch sets the size to 123% of the glyph advance (native width) of the "M" character.
      • 15pt sets the size to exactly 15pt. pt is in 72 DPI, so 15pt equals 20 physical pixels at 100% display scale (= 96 DPI).
      • 15px sets the size to exactly 15px. px is a "CSS pixel" and not physical pixels to avoid ambiguity. It's thus in 96 DPI, so 15px equals 30 physical pixels at 200% display scale.
  3. The size adjustment can be specified per profile as:
    {
        "cellSize": {
             "height": "...",
             "width": "..."
        }
    }

I'm not particularly happy about the design of the 3rd point and I'd be happy to hear suggestion how to better specify it. I'm not intending to write a settings UI control for this in an initial PR and only add it in a follow-up PR.

@DHowett
Copy link
Member

DHowett commented Oct 11, 2022

CSS pixel

Users who want to use a font like Terminus might want to specify a physical pixel size rather than a virtual one. Should we consider another suffix (and borrow from the Android resource language, or something else that offers px and dip?)

@lhecker
Copy link
Member

lhecker commented Oct 11, 2022

Users who want to use a font like Terminus might want to specify a physical pixel size rather than a virtual one. Should we consider another suffix (and borrow from the Android resource language, or something else that offers px and dip?)

I've thought about this and initially considered to add a physical pixel unit, but then realized: Bitmap fonts like that already require you to enter font sizes in exact pixels and not points, but we don't even allow anything but point sizes (just like most text editors). So basically if you want to use Terminus TTF you already need to know that 18px map to 13.5pt and once you know that you can write this given my proposal:

{
    "cellSize.y": "13.5pt",
    "font":
    {
        "face": "Terminus (TTF) for Windows",
        "size": 13.5
    }
}

@Diablo-D3
Copy link

Diablo-D3 commented Oct 12, 2022

It would be nice being able to specify CSS px (== 100% 96 dpi) along with pt to disallow any ambiguity, not only in cell height/width but also font size in general.

@joakin
Copy link

joakin commented Oct 13, 2022

I'm not particularly happy about the design of the 3rd point and I'd be happy to hear suggestion how to better specify it.

A couple of suggestions:

{
    "cellSize": {
        "x": "...",
        "y": "..."
    }
}

I personally think that width and height are more understandable as settings, so, one of these would be nice:

{
    "cellSize": {
        "width": "...",
        "height": "..."
    }
}
{
    "cellSizeWidth": "...",
    "cellSizeHeight": "...",
}

@ghost ghost added the In-PR This issue has a related PR label Oct 19, 2022
lhecker added a commit that referenced this issue Feb 14, 2023
Does what it says in the title. After this commit you can customize the height
and width of the terminal's cells. This commit supports parts of CSS'
`<length-percentage>` data type: Font-size relative sizes as multiples (`1.2`),
percentage (`120%`), or advance-width relative (`1.2ch`), as well as absolute
sizes in CSS pixels (`px`) or points (`pt`).

This PR is neither bug free in DxEngine, nor in AtlasEngine.
The former fails to implement glyph advance corrections (for instance #9381),
as well as disallowing glyphs to overlap rows. The latter has the same
overlap issue, but more severely as it tries to shrink glyphs to fit in.

Closes #3498
Closes #14068

## Validation Steps Performed
* Setting `height` to `1` creates 12pt tall rows ✅
* Setting `height` to `1ch` creates square cells ✅
* Setting `width` to `1` creates square cells ✅
* Setting `width` or `height` to `Npx` or `Npt` works ✅
* Trailing zeroes are trimmed properly during serialization ✅
* Patching the PR to allow >100 line heights and entering "100.123456"
  displays 6 fractional digits ✅
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Feb 14, 2023
@cool-RR
Copy link

cool-RR commented Mar 6, 2023

New to this thread, and to this project. I just tried to use this feature. I ran the command "Open settings file (JSON)", and in the "defaults" item I've put this:

    "cellSize": {
         "height": "20",
         "width": "20"
    }

I launched Windows Terminal but saw no effect. Am I doing something wrong?

@zadjii-msft
Copy link
Member

@cool-RR What version did you try that on? This hasn't shipped in 1.16 or 1.17 - it's only checked in to main to be shipped in 1.18.

@cool-RR
Copy link

cool-RR commented Mar 8, 2023

Ah, I see. Indeed I tried it on 1.16.10261.0. I'm not good at building... Is there a way for me to run the latest main code without having to go through a technical building process, and without affecting the currently-installed version of Windows Terminal on my computer?

@Diablo-D3
Copy link

It seems a lot of people want this feature. Any chance of it arriving early in a 0.17-and-a-half release, or are there too many invasive changes to get it to land here?

@o-glethorpe

This comment was marked as off-topic.

@alcm-b
Copy link

alcm-b commented Jul 18, 2023

Windows terminal's line spacing is obviously too large when compared to what other command line tools have (user of Putty, XShell, mintty, Gnome terminal here). I'd like to have it either fixed (optimally) or made configurable (acceptable).

@zadjii-msft
Copy link
Member

@alcm-b as discussed in literally the last 5 comments, this is already configurable as of version 1.18. Try something like:

"font":
{
    "face": "Consolas",
    "size": 12,
    "cellHeight": ".9"
}

@alcm-b
Copy link

alcm-b commented Jul 18, 2023

@zadjii-msft thanks for pointing that out - it really is there in 1.18 👍

Moving the ticket away from backlog would help near-sighted people like me.

cellHeight = 1.1 looks great:

image

@zadjii-msft zadjii-msft modified the milestones: Backlog, Terminal v1.18 Jul 18, 2023
@khushal123
Copy link

cellHeight does not work, tried multiple options. This should be a straight forward setting.

@Gonkers
Copy link

Gonkers commented Dec 6, 2023

cellHeight does not work, tried multiple options. This should be a straight forward setting.

I just came upon this thread, and I found that cellHeight worked for my needs. It does take decimal values.

            "font": {
                "face": "Cascadia Mono",
                "size": 10,
                "weight": "normal",
                "cellHeight": "1.3"
            }

@liuyang12
Copy link

I confirm that cellWidth and cellHeight under font are exactly what I want and work perfect for me. Here is a example of Fira Code.

"font": 
{
    "cellWidth": "0.58",
    "cellHeight": "1.15",
    "face": "Fira Code Retina"
},

screenshot of Windows Terminal
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-Settings Issues related to settings and customizability, for console or terminal Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.