Introduce UnicodeAttribute for better Unicode support#5407
Introduce UnicodeAttribute for better Unicode support#5407skyline75489 wants to merge 6 commits intomicrosoft:mainfrom
Conversation
|
This is what I got by far using the reproducing code in #3546 : There's still something missing (the umbrella emoji is small) . Considering how many lines of code this PR actually adds, I feel it's quite worth the effort. I'll take a look and check that if it also fixes the other Unicode related issues. By the way |
|
|
||
| std::wstring* currentText = new std::wstring(it->Chars()); | ||
|
|
||
| while (moveForward) |
There was a problem hiding this comment.
This is of course a very naive implementation. But I think it's a good start.
| bool inJoiner = nextCell->UnicodeAttr().IsJoiner(); | ||
| bool moveForward = nextCell && (nextCell->UnicodeAttr().IsBackwordAdhesive()); | ||
|
|
||
| std::wstring* currentText = new std::wstring(it->Chars()); |
There was a problem hiding this comment.
This is just purely wrong. I couldn't find a way to concat two std::string_view. Neither can I access the underlying text buffer. I had to allocate a new string to get the content I need. I'd love to hear some opinions.
There was a problem hiding this comment.
Perhaps use of the newly added to deps: https://github.com/fmtlib/fmt might help?
|
|
||
| void SetGlyph(std::wstring_view glyph) noexcept | ||
| { | ||
| const auto codepoint = CodepointWidthDetector::ExtractCodepoint(glyph); |
There was a problem hiding this comment.
I basically just pulled these from Unicode.org Website
New misspellings found, please review:
To accept these changes, run the following commands✏️ Contributor please read this
See the
|
New misspellings found, please review:
To accept these changes, run the following commands✏️ Contributor please read this
See the
|
|
Hey for the record, we're all pretty heads down with getting the 1.0 release ready at the moment - it might be a bit before we can get to reviewing this. Thanks for your patience! |
|
This is a stale PR. Closing it for now. |

Summary of the Pull Request
This is the successor of #3578 which aims to improve Unicode support in the perspective of M:N cell rendering and ZWJ/ZWNJ.
References
#1472 #3546 #3578
PR Checklist
Detailed Description of the Pull Request / Additional comments
I'm trying to add the possibility of Unicode support while leaving good old
cmd.exealong. So I added aUnicodeAttributeclass, which is specifically crafted for the all kinds of Unicode thingy.The code is in its very early stage and the tests are left broken. Just wanna share the idea.
I managed to get many features including Combing/ZWJ/ZWNJ to work. Emoji with VSS-16 also works . But without VSS-16 those emoji will still be half-sized.
Hangul composition requires more interaction with clusters inside CustomTextLayout which I believe is out of the scope of this PR.
I'm not really sure what I did in the PR is the correct direction overall. Cluster category and adhesive logic (which @reli-msft mentioned) may also leads to the same result.
Validation Steps Performed
WIP