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

Added unicode testing code to TableEditor #1761

Merged
merged 1 commit into from
May 30, 2022
Merged

Conversation

tznind
Copy link
Collaborator

@tznind tznind commented May 30, 2022

Fixes #152

This PR adds a new table to TableEditor scenario that includes all unicode symbols in the ranges defined here:

https://jrgraphix.net/r/Unicode/

I've designed it so its easy to add more later if there are other ranges that you want to test. Hitting Enter shows the unicode uint value of the cell and the name of the range it is classified as.

unicodetable

@tig
Copy link
Collaborator

tig commented May 30, 2022

Did you happen to look at the ranges I used in Character Map?

@tig
Copy link
Collaborator

tig commented May 30, 2022

Screwing around with this (which is an awesome stress test btw) I think I found a rendering bug.

image

Note when I use keyboard I can determine the glyph causing the issue:

image

(Can you show the code in hex in the dialog?)

Interestingly, CharMap has no issue in this range.

image

@tig
Copy link
Collaborator

tig commented May 30, 2022

Not worth holding merging this, but check this out:

Character Map has a bit of a mis-render with those glyphs (around 0x202A, 0x202B, 0x202C) too, FWIW.

image

Copy link
Collaborator

@tig tig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome.

@tig tig merged commit 5b4716b into gui-cs:main May 30, 2022
@tznind
Copy link
Collaborator Author

tznind commented May 31, 2022

(Can you show the code in hex in the dialog?)

The hex code is the title of the menu box e.g. 202A. But I agree it should be formated 0x0202A.

Its interesting behaviour there. I see from the unicode docs that 202A is LEFT-TO-RIGHT EMBEDDING

The "LEFT-TO-RIGHT EMBEDDING" directional formatting character is the classical Unicode method of explicit bidirectional formatting, and as of Unicode 6.3, is being discouraged in favor of LEFT-TO-RIGHT ISOLATE. An "embedding" signals that a piece of text is to be treated as directionally distinct. The text within the scope of the embedding formatting characters is not independent of the surrounding text. Also, characters within an embedding can affect the ordering of characters outside. Unicode 6.3 recognized that directional embeddings usually have too strong an effect on their surroundings and are thus unnecessarily difficult to use.

From docs (emphasis mine)

I think that the reason it jumps like that is because of the color change when you select the cell. So when not highlighted the terminal sees:

blah blah<control-character>blah blah blah blah

When theres a color change the console sees:
blah blah<changecolor> <control-character>blah <changecolor> blah blah blah

This probably makes the control characters effects end at the color change instead of the end of the next row.

@tznind
Copy link
Collaborator Author

tznind commented May 31, 2022

Did you happen to look at the ranges I used in Character Map?

I've added those ranges in #1762

@BDisp
Copy link
Collaborator

BDisp commented May 31, 2022

When I fixed the wide runes on the NStack repo, I tried fix this behavior by adding spaces to it, but that also pushed the runes to the right causing misalignment worsening the situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

how to use listview item selection
3 participants