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

Wide Glyphs do not work correctly on conhost #2943

Open
tig opened this issue Oct 30, 2023 · 7 comments
Open

Wide Glyphs do not work correctly on conhost #2943

tig opened this issue Oct 30, 2023 · 7 comments
Labels
v2 For discussions, issues, etc... relavant for v2
Milestone

Comments

@tig
Copy link
Collaborator

tig commented Oct 30, 2023

Run the scenario Buttons with host console and you'll see the same. I really don't know why this happens but I'm sure the right string are passed to the console.

image

Originally posted by @BDisp in #2928 (comment)

This problem is not just about Button. conhost operates differently from WT when rendering wide glyphs.

Run CharMap under conhost to see:
image

Note that NetDriver doesn't work correctly either.:
image

@tig tig added the v2 For discussions, issues, etc... relavant for v2 label Oct 30, 2023
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Oct 31, 2023
@tig
Copy link
Collaborator Author

tig commented Oct 31, 2023

I am beginning to suspect the REAL problem is Rune.GetColumns(), which depends on wcwidth is returning values different than what WT is using internally (and WT an conhost behave differently in this regard).

The real fix to all of this is to figure out how to calculate the number of columns the same way WT is doing it.

@BDisp
Copy link
Collaborator

BDisp commented Oct 31, 2023

I am beginning to suspect the REAL problem is Rune.GetColumns(), which depends on wcwidth is returning values different than what WT is using internally (and WT an conhost behave differently in this regard).

You probably are right. Maybe you can open an issue on the owner repo?

The real fix to all of this is to figure out how to calculate the number of columns the same way WT is doing it.

Yes, this probably be a good choice. Do you are going to investigate the code?

@tig
Copy link
Collaborator Author

tig commented Oct 31, 2023

Yes, this probably be a good choice. Do you are going to investigate the code?

Yes, I am actively working on this as part of #2610

@tig tig changed the title Default button bracket glyphs don't work on conhost Wide Glyphs do not work correctly on conhost Oct 31, 2023
@BDisp
Copy link
Collaborator

BDisp commented Oct 31, 2023

I think that haven't anything related with wide char. I did this change to GetColumns:

image

and the result is:

image

The width is really 1 but conhost doesn't render well on all situations with certain character.

@tig
Copy link
Collaborator Author

tig commented Nov 1, 2023

It's more subtle than that. How each terminal internally stores code points in cells and how it deals with cells to the left or right varies widely.

Run v1 charmap in conhost/wt/netdriver/windowsdriver and see wild differences.

@BDisp
Copy link
Collaborator

BDisp commented Nov 1, 2023

It's more subtle than that. How each terminal internally stores code points in cells and how it deals with cells to the left or right varies widely.

You are right is terminal dependent. The case of the the terminal doesn't handle the same way for all of them. In this case is only on the second button of the Top app and on the Dialog the situation is worst.

Run v1 charmap in conhost/wt/netdriver/windowsdriver and see wild differences.

Yes I already did and I see it happens with WindowsDriver and NetDriver. We can't do nothing unless it's fixed by Microsoft I guess.

@BDisp
Copy link
Collaborator

BDisp commented Nov 1, 2023

@tig see this code point U+1085F “𐡟” where seems to occupies two columns but GetColumn return one. I know that depend if the font support or not a code point but cmd and conhost support it. It feels like it gets too tight.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 For discussions, issues, etc... relavant for v2
Projects
Status: No status
Status: No status
Development

No branches or pull requests

2 participants