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
Define width? #43
Comments
@ghostsquad The doc for Instead flag emojis are made of 2 runes/codepoints. So this package is more about East Asian characters, not emojis. |
@ghostsquad uniseg.GraphemeClusterCount might interest you: it will tell you how multiple runes combine for a single grapheme. But that's not a complete solution to you problem (I suppose rendering in a terminal emulator): it will not tell you how much space is used to render that grapheme in a monospace font (especially as "monospace font" and "modern renders" are fuzzy). |
@dolmen yep I already looked at uniseg, and it doesn't provide the right information |
You can kinda see some of the problems I'm trying to solve... it seems not even all monospaced fonts are made equally. From the github code view, you can see that the right padding misaligns the text. But from the screenshot (of my terminal, using Fira Mono for Powerline), the right padding is needed.
|
well, I might have landed on something interesting...
this is probably good enough for what I need. |
Hello, I maintain the python wcwidth library, and I recently wrote a specification that is of interest to this specific issue. I also wrote an automatic testing tool to asses any individual terminal emulator's compliance to the specification for Wide, Zero, ZWJ, and Emoji VS-16 character sequences. I wrote an overview here https://www.jeffquast.com/post/ucs-detect-test-results/ I just want to point out, most especially, the automatic test results for 20+ terminals, that indeed you will find varying levels of unicode version and feature support across terminals, so it is important to keep that in mind when trying to validate. |
This is a question about how you are defining "width"? I'm mostly looking for a solution that gives me character width in monospaced fonts. So example in #39 and #36, the "width" would still be
2
as a flag although is considered 1 character in modern renders, it still takes up the space of 2 normal characters.The text was updated successfully, but these errors were encountered: