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

could we provide a legacy font render option like windows console host style? #15710

Closed
zhishi opened this issue Jul 14, 2023 · 14 comments
Closed
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Task It's a feature request, but it doesn't really need a major design. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@zhishi
Copy link

zhishi commented Jul 14, 2023

Description of the new feature/enhancement

Currently I'm doing coding work mostly on remote host via ssh, and I liked the new windows terminal a lot. However there is one thing caused me to go back to the old windows console host. There is minor difference between the new windows terminal and the old windows console host on font rendering style, but it just annoys me enough to not using windows terminal.

As I know font show different size on windows terminal and windows console host. For example when I use consolas font, I need choose size 11 in windows terminal to match the size 16 in windows console host:
image

And that size 11 still can't generate same width and height like the size 16 in windows console host, it has a little bit wider and taller space between characters. which results in less lines and text showed in my text editor, for example you can see below picture showed the gap of lines become bigger and bigger between the windows console host (background) and windows terminal:
image
Another problem showed in above picture is that green arrow in left side (if you are using zsh you should familiar with that arrow). The windows terminal for some reason render it much smaller than normal size, which just give a non-consistence overall view.

So overall I just like windows console host more for the compact and consistence render style (it also match iterm2 style better), but I guess it's not hard to add same render option in windows terminal since they share a lot code base. maybe just provide a checkbox with legacy render style?

@zhishi zhishi added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 14, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot 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 Jul 14, 2023
@lhecker
Copy link
Member

lhecker commented Jul 14, 2023

I'm intending to implement such an option for #14165. As a stop gap you can convert the font size of Consolas from conhost to Windows Terminal by dividing by 1.5611979167. A font size of 16 in conhost for instance corresponds to a font size of 10.24854045 in Windows Terminal. It should then look quite similar if not identical. 🙂

@zhishi
Copy link
Author

zhishi commented Jul 14, 2023

Glad to see I'm not the only one care about such minor things, I guess when people using terminal they usually expect everything aligned like a real terminal feeling. I tried the 10.24854045, but it doesn't work, I even used 10 now but the gap still bigger than conhost:
image
And the green arrow still very small. I think there is some fundamental difference between the two render engine rather than just font size calculation. really hopes we can have a toggle to switch to the conhost render completely.

@237dmitry
Copy link

237dmitry commented Jul 14, 2023

If you do not take into account the font sizes, then in my opinion their rendering, both in conhost and in wt, is almost identical. In conhost font size is 20, in wt 15.0. Font Agave Nerd Font.

"useAtlasEngine": false

Display scaling 100%

Screenshot 2023-07-15 020126

@lhecker
Copy link
Member

lhecker commented Jul 14, 2023

@237dmitry Is there a reason you use "useAtlasEngine": false? We're planning to remove the old text renderer in about 2 releases, so if there's something missing or broken, please let us know! 🙂

@zhishi
Copy link
Author

zhishi commented Jul 14, 2023

also could you try consolas font? I guess different font may have different effect.

@zhishi
Copy link
Author

zhishi commented Jul 15, 2023

Btw, I have another minor request (may need open a new issue?). I found the tab title bar just too tall which waste lots of screen space. could we make it as narrow as the conhost title bar?
image

@lhecker
Copy link
Member

lhecker commented Jul 15, 2023

@zhishi Ah if you want to also replicate the exact "cell size" of conhost then you'll have to do one more thing... If you install Windows Terminal Preview (version 1.18) and open the settings.json file, then next to your font "size" entry you can add this:

{
    "profiles":
    {
        "defaults":
        {
            "font":
            {
                "face": "Consolas",
                "size": 10.24854045,
                "cellHeight": "16px"
            }
        }
    }
}

There's also a matching "cellWidth" option. The argument is a CSS string and it supports pt, px, percentages, etc. The 10.24854045 as font size is correct (I've just tested it).

You have to do this, because right now the algorithm for determining the line height and cell width is slightly different from GDI as used in conhost. As part of #14165 I'll try to make the two match as closely as possible (without sacrificing accuracy). But there will always be a mismatch at certain font sizes and display scales, most importantly because GDI doesn't even use float - it does all calculations with integers! And so you get a slightly different rounding behavior...

Edit, Note to self: Will tag needs-discussion to learn more about tab title heights.

@lhecker lhecker added the Needs-Discussion Something that requires a team discussion before we can proceed label Jul 15, 2023
@zhishi
Copy link
Author

zhishi commented Jul 15, 2023

cool, thanks for the followup. I wonder could the green arrow size also caused by the integers? I'll give it a try.

@237dmitry
Copy link

237dmitry commented Jul 15, 2023

Is there a reason you use "useAtlasEngine": false?

I do not like Atlas as it is rendering some double place symbols incorrectly.

We're planning to remove the old text renderer in about 2 releases, so if there's something missing or broken, please let us know!

There are many terminal alternatives. Conhost is good also, if it could hide scrollbar and could clickable hyperlinks...

@lhecker
Copy link
Member

lhecker commented Jul 15, 2023

I wonder could the green arrow size also caused by the integers?

@zhishi No, not really. When you use conhost, the font determines how many columns a glyph occupies. Since the arrow is wide it occupies 2 columns. But Windows Terminal works more like most other terminals, where the Unicode standard UAX#11 determines how wide glyphs are. And there the arrow is considered 1 column wide.
If you use Windows Terminal Preview however it will result in an arrow that looks identical to the one in conhost anyways. That's because the new "AtlasEngine" in Preview allows glyphs to be wider than the amount of columns allocated to them, combining the way conhost works with the way other Terminals work:

image

I do not like Atlas as it is rendering some double place symbols incorrectly.

@237dmitry I'm also planning to make AtlasEngine the default in conhost at some point in the distant future. If you could tell us what it handles poorly, I'll fix it as soon as possible. 🙂
(But try out the Preview version 1.18 if you haven't done so yet. It has an entirely new version of the renderer which might have fixed your issue already.)

@237dmitry
Copy link

But try out the Preview version 1.18 if you haven't done so yet

Hmm, I tried turning on Atlas and it really works better than before. And I've been using 1.18 since its release. I guess I got so used to the fact that the Atlas Engine did not display some characters well that I was biased towards it and always turned it off. I apologize for the unfounded criticism. Now it really is much better.

@lhecker lhecker added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Task It's a feature request, but it doesn't really need a major design. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Needs-Discussion Something that requires a team discussion before we can proceed labels Jul 17, 2023
@lhecker
Copy link
Member

lhecker commented Jul 17, 2023

For compact title bars you can follow this issue #5911.

@carlos-zamora carlos-zamora modified the milestone: Terminal v1.19 Aug 2, 2023
@carlos-zamora
Copy link
Member

Since @lhecker is already working on this, I'm going to mark this as a /dup of #14165.

@microsoft-github-policy-service
Copy link
Contributor

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 2, 2023
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 Issue-Task It's a feature request, but it doesn't really need a major design. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

4 participants