Repository navigation
Closed
Labels
Area-RenderingText rendering, emoji, complex glyph & font-fallback issuesHelp WantedWe encourage anyone to jump in on these.In-PRThis issue has a related PRIssue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-Tag-FixDoesn't match tag requirementsPriority-1A description (P1)Product-TerminalThe new Windows Terminal.
Milestone
Description
There've been some concerns about how we scale glyphs in the Box Drawing character block.
Other terminal emulators do interesting things:
- Gnome-terminal uses little 5x5 bitmaps and stretches them to fill the entire cell (shout-out to Egmont Koblinger (@egmontkob) for telling me this!)
- This results in pixel perfect lines and shading.
- [Other popular terminal] uses line-drawing primitives at the graphics layer to mimic box drawing and rect-filling primitives with opacity to mimic block elements
- This also results in pixel-perfect lines and cool blended shading glyphs.
We chose not to do these things for v1.0 because we learned that certain fonts (monofur is a good one) have their own unique styles for box drawing and block elements that we wanted to preserve.
Proposed solution
- Add a setting for "Let Windows Terminal handle block / powerline drawing"
- This is a per-profile setting.
profile::compatibility.builtinBlockDrawing - When enabled, Terminal will manually draw box-drawing and powerline glyphs, replacing the glyph from the font
- Enable this by default
- Obviously, users will be able to opt out
- This will give us the benefit of getting PL glyphs even for fonts without them!
- We should probably start with a few of the glyphs as higher pri:
- Green: Definitely, in v0
- Yellow: okay probably yea
- Orange: meh
- red: probably too expensive (engineering wise)
- white: I can't imagine we'll actually need to draw these
- This is a per-profile setting.
- Add a secondary setting for "Replace filled rectangles with transparent glyphs"
- Only enable if
compatibility.builtinBlockDrawingis enabled
- Only enable if
Links
- Box drawing characters are not antialiased #6161 Block-drawing glyphs aren't antialiased
- Add preference to customize vertical line spacing #3498 may affect how we choose to draw these "pixel-perfect" glyphs.
- Anti-Aliasing for powerline font icons is poor when using 12 pt or lower #7260
Reacted by Tushar Singh and ExE Boss
Metadata
Metadata
Assignees
Labels
Area-RenderingText rendering, emoji, complex glyph & font-fallback issuesHelp WantedWe encourage anyone to jump in on these.In-PRThis issue has a related PRIssue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-Tag-FixDoesn't match tag requirementsPriority-1A description (P1)Product-TerminalThe new Windows Terminal.
Type
Projects
- StatusShow more project fieldsMini-spec in thread
Activity
[-]Investigate alternative ways to handle box/line drawing[/-][+]Investigate alternative ways to handle box drawing/block elements[/+]benc-uk commentedon May 14, 2020
The shaded/hatched boxes now look really bad since the last update.
A lot of themes like Powerlevel10k use these
This is my prompt now in Windows Terminal

This is what it should look like (In VS Code)

DHowett-MSFT commentedon May 14, 2020
yikes.
DHowett-MSFT commentedon May 14, 2020
Though, that looks like Cascadia Code. The version released yesterday with the new metrics works properly with Terminal. You may need to update.
benc-uk commentedon May 14, 2020
Hi, I just updated to CascadiaCode_2004.30, and I didn't see any difference :(

Weirdly if I set my font size to 15, the shading disappears altogether, and at font size 19 it looks perfect, but that's just too huge to use!
benc-uk commentedon May 14, 2020
Some further tests with Cascadia Code.
At font size 14 the line elements are super thin and the curved corner lacks any antialiasing/smoothing

At font size 13 they look much better

mdtauk commentedon May 14, 2020
I think if this is added, it should be behind a setting. Something like
☑ Let Windows Terminal handle block character drawing
Cascadia code has an interesting approach to the character of some of it's Block Characters, and other fonts will also. That character is lost by Terminal doing it itself - so it should be optional IMO
ionut-botizan commentedon May 19, 2020
I'd really love to see those "rect-filling primitives with opacity" make it into the Windows Terminal:
(the filling char I'm using is
$([char]0x2592)or "░")Obviously, the best looking one is the one on the right and the second best one is the one with the 15px font size. Sadly, 15px is way too big, so I'm stuck with the ugly looking one for now. 🙂
30 remaining items
he3als commentedon Jun 15, 2022
Are there any ways to fix this issue at the moment? I am using the default font.
jaminthorns commentedon Feb 3, 2023
I'd really love to see this implemented as it can provide a much nicer TUI experience. If this ends up happening, it'd be great if the Powerline symbols were implemented as well (don't forget the slants/triangles!).
Here's some further reading for anyone interested in how some other terminals handle rendering of box drawing characters:
stterminal: https://st.suckless.org/patches/boxdraw/ShelpAm commentedon Dec 4, 2023
Mystic8b commentedon Feb 6, 2024
Well, #16664 was closed, so I'm writing here.
I and tens of thousands of other people use zsh + p10k. And AtlasEngine breaks the prompt in p10k by cutting off the bottom pixel or something like that. In the last release you enabled Atlas by default, which means you are sure there are no problems, but this is not the case! This is a huge problem. Pay attention to this. Thank you!
Old engine:

New engine:

And no, it's not a font problem, I've tried every variation of Nerd Fonts. I asked the developer of p10k, he also said that it was a terminal problem.
zadjii-msft commentedon Feb 6, 2024
To loop back on this: I've updated the OP with our plan-of-record. Adding a setting to force Terminal to draw pixel-perfect glyphs seems like the right plan. It'll be a setting, so users can always feel free to opt-out if they want the glyph from their font instead.
Adding the setting itself is trivial.
Figuring out how to get the renderer to draw each of those shapes: that's a little more work. Hence why we've tried to group them by priority.
We'd probably appreciate help here, if someone's willing to figure out the glyph drawing 😉
lhecker commentedon Feb 16, 2024
Box drawing and block element glyphs are done:

Powerline glyphs are much more difficult to do, because a user's font may not have powerline glyphs in the first place and so there's nothing to
MapCharactersto. This made me realize that I need to do my ownMapCharactersin addition to what DWrite is doing and that will take some time because it requires additional work on the text renderer - work that isn't trivial unfortunately since DWrite is a little unwieldy.Add support for custom box drawing and powerline glyphs (#16729)