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

Font Glyphs are cut off by the Windows Terminal #5095

Closed
DoCode opened this issue Mar 24, 2020 · 15 comments
Closed

Font Glyphs are cut off by the Windows Terminal #5095

DoCode opened this issue Mar 24, 2020 · 15 comments
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Answered Related to questions that have been answered
Milestone

Comments

@DoCode
Copy link

DoCode commented Mar 24, 2020

Environment

Windows build number: 10.0.18363.0
Windows Terminal version (if applicable): 0.10.781.0

Steps to reproduce

Some Unicode glyphs are cut off, ONLY in Windows Terminal.

Expected behavior

ConEmu:

image

PowerShell Core:

image

PowerShell:

image

Actual behavior

Windows Terminal:

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 Mar 24, 2020
@fabienheureux
Copy link

fabienheureux commented Mar 24, 2020

Maybe related to #4974 ?
Do you use a font with ligatures ?

@DoCode
Copy link
Author

DoCode commented Mar 24, 2020

No ligatures, but oversized glyphs. But I preserve space for it with one empty char as postfix for each oversized glyph.

But why only Windows Terminal struggled with this?

@fabienheureux
Copy link

Well, I honestly don't know...but as the v1.0 is not yet released, this is understandable.

@zadjii-msft zadjii-msft added Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. labels Mar 24, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 24, 2020
@zadjii-msft zadjii-msft added this to the Terminal v1.0 milestone Mar 24, 2020
@skyline75489
Copy link
Collaborator

@DoCode How do you print this kind of 'oversized' glyph, though. I've tried echo -e '\U0001f602' it only gives me a regular sized folder.

@DoCode
Copy link
Author

DoCode commented Mar 24, 2020

@fabienheureux - ok thanks.
So I hope MS would address this issue for the 1.0 milestone.

@DoCode
Copy link
Author

DoCode commented Mar 24, 2020

@DoCode How do you print this kind of 'oversized' glyph, though. I've tried echo -e '\U0001f602' it only gives me a regular sized folder.

@skyline75489 - I print this kind with simple following a whitespace, like echo -e '\uF07C'' ' to preserve overlapping.

This works on all platforms and terminals, except the new Windows Terminal!

@zadjii-msft
Copy link
Member

zadjii-msft commented Mar 24, 2020

@DoCode could you share what font you're using as well?

Also, are you sure that \uF07C is the glyph you want? I'm pretty sure that's not a valid unicode character. \U0001F5C1 looks a bit like what you want...

@DoCode
Copy link
Author

DoCode commented Mar 24, 2020

@zadjii-msft yes, \uF07C, that's the glyph I want. It's ported from powerleve10k and this used larger icons. Works like a charm as I said.

Here's the font I used.

@DoCode
Copy link
Author

DoCode commented Mar 24, 2020

FYI, also the integrated VS Code terminal works like a charm:

image

@jdebp
Copy link

jdebp commented Mar 24, 2020

U+F07C is in the Unicode Private Use Area. Powerline, and "nerd fonts", fill this up with a whole bunch of stuff. Their users are sometimes surprised, in my experience, to learn that Private Use Area really does mean something that does not work the same everywhere. In this case, Windows Terminal is treating the character as a narrow character. The whole Private Use range is marked as "ambiguous" width in the Unicode standard.

U+1F5C1 is a standard character, with narrow width. Amusingly, Unicode version 13 now gives you U+1FBB9 and U+1FBBA for making a wide folder icon in a text display, in the way that computer people used to. (-:

@DoCode
Copy link
Author

DoCode commented Mar 24, 2020

@jdebp thanks for the detailed explanation.
I will try your suggestions about unicode version 13.
However, I don't think it's okay that Windows Terminal doesn't behave like all other terminals. This will annoy many users. Windows Terminal is not the first and primary terminal on the market and should be as compatible as possible.

@cinnamon-msft cinnamon-msft added Priority-1 A description (P1) and removed Priority-2 A description (P2) labels Mar 24, 2020
@waltermaldonado
Copy link

I can confirm the same behavior here, but it is not present only in the Windows Terminal app. If Iuse WSL with the default terminal app, I get the icons from lsd cut off too.

Look closely to the folder's icons.

image

image

@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Mar 26, 2020
@DHowett-MSFT
Copy link
Contributor

It's a very unfortunate situation that we've been put into by the ill-defined use of the private use area. We may need to fix this as part of a holistic look at how we handle ambiguous-width characters.

@DHowett-MSFT
Copy link
Contributor

So, I've just installed one of these "fonts for nerds" and I cannot reproduce this issue in 0.11. There's an overlap problem, but I'm not seeing your folder glyph cut off if appropriate space is left for it.

image

If appropriate space isn't left for it, there's not much we can do.

At the end of the day, this glyph is reported as being "ambiguous" width and we've decided that ambiguous glyphs are one cell wide. Sorry.

For the record, this seems to be very close to xterm's behavior (xterm-344 pictured below).

image

and gnome-terminal

image

@DHowett-MSFT DHowett-MSFT added Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered and removed Issue-Bug It either shouldn't be doing this or needs an investigation. labels Apr 24, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Apr 24, 2020
@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented Apr 24, 2020

Yes, we don't let the font outside of its bounding box if we're about to put another character right up against it. The result of striking the C or < down over the right side of the folder is visually offensive and cannot possibly be clearer than cutting it off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

8 participants