-
Notifications
You must be signed in to change notification settings - Fork 66
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
Table width and number of characters #18
Comments
Thank you @huashan for reporting this issue. But please give me a hand with the solution as I have no experience with CJK characters. The Could you please also write here an example for the case so that I could test? |
The default for type is |
Right, so there is no sense in replacing |
you need to use |
Cool, thanks a lot for making this clear to me. |
Just did some testing (sorry, I have no idea what is that character is below, but looks cool):
So I decided to choose Before:
After:
Thanks again for reporting this issue and I would love to hear some feedback if this works or if there would be any need for more tweaks. |
Thanks Daroczig! Another related issue is |
Thanks a lot! First I tried to fix this issue with a way you described as "a little bit cumbersome" - but was easier to implement. After all I was not pleased with this method, as e.g. you might have a mixed cell with both e.g. latin and CJK chars, so that it might split a word with even latin chars. Just imagine: you might have a cell with a latin text and some Unicode chars, this could be split by any char, not just at white spaces - which is not good. So I tried to work on the second option too: currently the script would check the real width of each word and split text on white space based on Demo:
|
The CJK characters are completely splitable, so the last few lines should be expected to be: or: |
Hm, that's a feature not a bug based on the last commit :) But joking apart, in your last comment you wrote that "Or we have to treat each CJK character as two and then split at the first whitespace." So I implemented that as it seems pretty hard to check if CJK or any other Unicode character is present, and other chars would probably not allow break(s) between them. So @huashan please verify if handling CJK chars as double and breaking those only on white-space would work, or we need some more magic here. |
I see in
helper.R
thatPander
usesnchar()
to determine column width by number of characters in the string. That is not suitable for cjk characters, I'd suggest usingnchar(x, type='type')
to handle CJK characters.The text was updated successfully, but these errors were encountered: