linde12 / kod

terminal text editor written in Go, using xi-editor as backend
MIT License
315 stars 20 forks source link

Right-to-left languages seem to be unhandled #28

Open sixtyfive opened 6 years ago

sixtyfive commented 6 years ago

When trying to write RTL languages such as Arabic or Aramaic (the two I happen to be working with regularly, didn't try an unconnected one like Hebraic), it looks like this:

image

The expected result would be like what e.g. gxi displays:

image

Note that in the second screenshot, some will argue that the RTL languages should not be aligned to the left edge of the window. I disagree partly. That's good behaviour for documents that are RTL only but mostly, in a text editor, one will be working with LTR/RTL-mixed documents, where it's much less confusing to have a main direction, so the above is actually really nice and shows that xi-core itself doesn't seem to have a problem with it.

sixtyfive commented 6 years ago

(Minor additional point: I've never seen anything that automatically adjusts font size to make the different scripts look the same size relative to each other, but it's worth mentioning. Arabic is usually too small, although here it looks a little too big in both examples. Aramaic is too small in both, as compared to the latin script reference text.)

linde12 commented 6 years ago

Cool! Nice find, i have actually never tried. This should definitely be supported, but when would depend on the implementation cost/willingness of contributor. Maybe we could have a look at gxi and see how it's being done there.

sixtyfive commented 6 years ago

I don't know Go (or Rust) but I'll be watching the issue in case there's questions about what looks right or what doesn't :)

linde12 commented 6 years ago

I think this should be solved if we "just" draw the unicode characters correctly. At the moment kod doesnt support fullwidth chars or unicode modifier chars.