microsoft / cascadia-code

This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.
Other
25.16k stars 797 forks source link

Thin vertical line box drawing character U+2502 does not fill the line height #577

Open bavis-m opened 2 years ago

bavis-m commented 2 years ago

Cascadia family version

2108.26

Cascadia family variant(s)

Cascadia Mono (the version without ligatures)

Font file format(s)

.ttf (variable)

Platform

Windows 10

Other Software

No response

What happened?

Some of the box drawing characters, such as U+2588, the full cell solid block, fill up the entire vertical line space: image

However, I can't find a thin, centered, vertical line that does the same. U+2502, the centered thin vertical line character from the same box drawing set, doesn't do so: image

This makes terminal UI look pretty awful (for instance, TMUX vertical splits): image

aaronbell commented 2 years ago

Hmmm. Interestingly, 2502 is actually taller than 2588, but the height is arranged slightly differently. I suspect that your coding environment is clipping the bottom off of the glyph, causing it to not connect properly. I think I can shift the positioning of these to be more aligned with what you're looking for without causing regressions.

albertus82 commented 2 years ago

Hello, I'm still experiencing this issue with v2110.31, Cascadia Code PL SemiBold, size 12, ClearType enabled:

image

Thanks.

ChristianGfK commented 2 years ago

@DHowett, can we reopen this? It seems this issue was not fixed by #587. I'm seeing the same thing with the Unicode line drawing characters, on Windows 10, using PuTTY. Additionally, the vertical lines seem to overlap a bit as well (see the bulges on the horizontal line).

Consolas 11 pt regular: image

Cascadia Code Mono 2110.031 10 pt light: image

Cascadia Code Mono 2110.031 12 pt regular: image

ChristianGfK commented 2 years ago

Additionally, I guess this might be similar to: https://github.com/microsoft/cascadia-code/issues/586 https://github.com/microsoft/terminal/issues/11574

zadjii-msft commented 1 year ago

Hmm, this Terminal thread seems related: https://github.com/microsoft/terminal/issues/14654

I haven't been following this repo as closely, so idk if this is the most up-to-date thread on the topic

riverar commented 1 year ago

Ping, requesting re-open @DHowett

riverar commented 1 year ago

Re-requesting re-open @DHowett @zadjii-msft

DHowett commented 1 year ago

I'm still not certain about this issue! When I look at this font in FontForge, this glyph for sure fills the entire cell height and then some.

Of the lines that extend across the entire image: the top horizontal line is the top of the bounding box. The one below it is the baseline, and the one below that is the bottom.

The glyph for sure extends beyond the bounds by more than a few design units.

Are we sure this is a font issue and not an application issue?

Regardless, until we figure that out.. sure, I'll keep this open.

DHowett commented 1 year ago

Furthermore... this is what I see for PuTTY 0.78 with Cascadia Code at the same size.

image

Terminal:

image

ChristianGfK commented 1 year ago

That is very strange indeed. I present:

Terminal Preview 1.18.1462.0, Cascadia Code 2111.001 Regular 12 pt image

Putty 0.78, Cascadia Code 2111.001 Regular 12 pt image

But while grabbing these I noticed that if you put them side by side: image

Uhhh...

Adjusting the line height in Terminal to 1.3 almost makes them line up: image

In any case, that half-answers "What is Putty doing differently?" (line height, apparently) and leaves "Why is Putty doing it differently?"

Spoilers: I'm not using OS-level scaling, i.e. "Settings -> Display -> Scale" is at 100%, screen resolution matches physical resolution of the display, "Settings -> Ease of Access -> Make everything bigger" is at 100%, so is "Make text bigger" in that same place.

ChristianGfK commented 1 year ago

Addendum: I hope this is not a case of https://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/typographical-metrics.html / https://github.com/googlefonts/Inconsolata/issues/35 because then it would probably be a dead end. Considering it works for @DHowett, there's a chance it's not related...

aaronbell commented 1 year ago

If I had to guess, Putty is getting the shorter sTypo versions of the lines but rendering using the larger winAscent/winDescent values. So it is falling through the cracks so-to-speak.

Many older software assumes the winAscent / winDescent values to be set tightly in coding fonts, but that isn’t the case for Cascadia.

aaronbell commented 1 year ago

@ChristianGfK ahh I just saw your links. Yes I believe it is the exact same problem. I put a “trick” in to try and get around the issue but it appears that Putty’s text render respects my trick but still locks to the larger metrics.

ChristianGfK commented 1 year ago

Alright, so that leaves this at "a future version of Putty might do this correctly" stage... @DHowett, are you from the future?!

aaronbell commented 1 year ago

Might also be that @DHowett has his line heights set differently?

ChristianGfK commented 1 year ago

Line height is not configurable in Putty, yet, his Putty somehow Does It Right™.

DHowett commented 1 year ago

I'm quite surprised by that! I have no idea why. :smile:

riverar commented 1 year ago

Let's please not get distracted by Putty. This is an issue that was introduced when Cascadia Mono font was upgraded from 2102.025 to 2106.017 and affects Windows Terminal too.

https://github.com/microsoft/terminal/issues/14654 https://github.com/microsoft/terminal/issues/11574 https://github.com/microsoft/cascadia-code/issues/586

riverar commented 1 year ago

@aaronbell @dhowett Any hope for progress here? Coming up on two years now.

riverar commented 1 year ago

This issue does not reproduce in Windows Terminal using the new Atlas engine, soon to become the default per conversation. Probably best we categorize this as "known issue in old engines" and move on.