nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: support for RTL text directly in the terminal?


From: Mahyar Abbaspour
Subject: Re: support for RTL text directly in the terminal?
Date: Wed, 12 Feb 2020 23:49:35 +0330

On Wed, Feb 12, 2020 at 10:10 PM Benno Schulenberg <address@hidden> wrote:

Op 12-02-2020 om 02:31 schreef Mahyar Abbaspour:
> On Tue, Feb 11, 2020 at 7:24 PM Benno Schulenberg <address@hidden
> <mailto:address@hidden>> wrote:
>     My question is: is this usable?  I mean: can one comfortably edit an RTL
>     text using nano on mlterm?  Or is it awkward, confusing, troublesome?
>
> Thanks for reviving this topic. To be honest, I don't use mlterm. I have tried it
> a few times during the past few years but in every try, I was unable to get any
> decent RTL output from it.

Sorry to hear that.  I had hoped it would work reasonably well, well enough
that one would be able to say that there's no need to build RTL support into
nano.  Alas...

Yes it's really unfortunate.
 
Meanwhile I've played a bit more with nano and RTL on mlterm, and indeed,
it has problems.  For example, when I open two files, one with a Hebrew
name and another with a Latin name (I use Hebrew because I can recognize
some of its letters, so it's easier for me to see whether they are in the
proper order), then for the Hebrew one all three elements in the title bar
get swapped around: [1/2] is on the right side, and when I type something,
"Modified" is on the left.  That's quite funny.  When I then switch to the
other buffer, <Esc> followed by ">", then M2/2] appears on the left -- the
"[" is missing and the "M" of "Modified" doesn't get overwritten.  When I
switch some more between the buffers, at some point both names are in the
title bar together.  :|

Also, when typing ^K on a line that has a short piece of RTL text, the text
does not disappear: ncurses is not aware that there is text on the right side
of the display and does not emit any command sequences to clear it.  This can
also be seen by typing ^G a few times: any RTL text on the right side doesn't
get cleared when the help text is being shown.

You're right. There are many corner cases and looks like mlterm fails in many of them.
 
So, for RTL or bidirectional text to work properly, it would need support
in nano itself.  I've found your nano clone on Github [1], but it seems you
didn't push any of your work there? 

Looks like I didn't. I think at that time, nano was using svn. I converted the repo from
svn to git but looks like I never pushed my work there.
 
Probably it's far too much work to add
this support to nano, anyway.

Indeed it's a big project but it's definitely doable.
 
Do you know of any terminal editor that has
full or good support for RTL text? 

I guess Knosole (the terminal emulator of the KDE desktop) supports RTL to some
extent because of the Qt toolkit. I think the most promising one is gnome-terminal
which added support for bidirectional text in their 3.33.3 release [1]. At least, it does
the shaping phase right.
 
Or any graphical editor?  And how about
Libreoffice?  Can you write Persian in Writer without any problems?  Or are
there still some things to be desired there too?

As far as I know all graphical editors in Gnome environment support bidi text thanks
to the Pango [2] and HarfBuzz [3] libraries. The support for bid text is built-in in KDE
environment because of Qt. I'm not sure about other desktop environments such as
Xfce. Emacs GUI also supports bidi text.

[1] https://mail.gnome.org/archives/gnome-announce-list/2019-July/msg00003.html
[2] https://pango.gnome.org/
[3] https://www.freedesktop.org/wiki/Software/HarfBuzz/


--
Best regards,
Mahyar

reply via email to

[Prev in Thread] Current Thread [Next in Thread]