rustty icon indicating copy to clipboard operation
rustty copied to clipboard

wide character support

Open mathstuf opened this issue 9 years ago • 5 comments

Found this through TWiR :) . It looks like the API assumes each character is one cell wide, but this isn't true of Kanji and other ideographic languages. IIRC, some codepoints even change width based on the locale too (so punctuation is the same width as the rest of the characters, but I can't remember exactly). Any plan to support wide characters or did I skim the API too quickly? Thanks.

mathstuf avatar Aug 13 '15 05:08 mathstuf

Thank you for reporting this! At the moment we do not have wide character support, however I plan on implementing this soon.

cpjreynolds avatar Aug 13 '15 15:08 cpjreynolds

Going off the code written in termbox, I don't believe this will be too hard to implement. This should make in into rustty very soon.

cpjreynolds avatar May 23 '16 14:05 cpjreynolds

Hello, I'm quite interested in this as well. If this is something you're still planning on doing, do you mind giving a ballpark estimate of when? Otherwise I might want to look into this myself, in which case it would be nice to hear any thoughts you've already had about it.

ghost avatar Jul 19 '16 11:07 ghost

So I've taken a hard look at the issue of supporting wide characters and have encountered a fairly fundamental problem. rustty's abstraction over the underlying terminal relies on the assumption that each Cell occupies only the space which it represents; thus if one cell was to draw a wide character, it would end up drawing into the adjacent cell's space, which would in turn be overwritten when that adjacent cell is drawn.

I'm open to any and all suggestions as to how to handle this, but at the moment I'm drawing a blank.

cpjreynolds avatar Jul 20 '16 18:07 cpjreynolds

Another thing is that there are zero-width characters (for things like ZWJ and friends, but also potentially some escape codes as well).

Might be worthwhile to look into how tmux represents these things (since it does support wide characters).

mathstuf avatar Jul 20 '16 22:07 mathstuf