From: Naheel Azawy <naheelazawy@gmail.com>
To: eliz@gnu.org
Cc: 32516@debbugs.gnu.org
Subject: bug#32516: 26.1; Reshape Arabic Characters in the Terminal
Date: Sat, 25 Aug 2018 01:25:22 +0300 [thread overview]
Message-ID: <CAJr1c0LOzccnrf60O5-6p+v+SzK9=Yr3qKcrcRTDqBzKTaxECA@mail.gmail.com> (raw)
In-Reply-To: <83o9ds9t24.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2918 bytes --]
Thanks for you quick reply!
Nope, auto-composition-mode didn't help.
But https://github.com/behdad/bicon/pull/20 did!
Now `bicon.bin --reshape-only emacsclient -nw $@` is pretty ok.
It still has some issues but that should be fixed in bicon.
Thanks,
On Fri, Aug 24, 2018 at 9:29 AM Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Naheel Azawy <naheelazawy@gmail.com>
> > Date: Fri, 24 Aug 2018 00:06:19 +0300
> >
> > The problem occurs in the terminal mode with Arabic characters. Emacs
> > handles the bidirectional text correctly in terms of direction but it
> > doesn't reshape the characters depending on its location. More details
> > can be seen with screenshots on my question in Emacs stack exchange:
> > https://emacs.stackexchange.com/questions/44144/arabic-in-terminal-mode
> > I have also written a little minor mode as workaround to this problem:
> > https://github.com/Naheel-Azawy/emacs-arabic-reshaper
> > but an actual solution is expected to only render the characters while
> > they're displayed in the screen and not reshape the entire file as I'm
> > doing with my minor mode.
>
> Does it help to turn off auto-composition-mode?
>
> If that doesn't help, then I'm afraid you will have to look for a
> terminal emulator that supports character composition and Arabic
> shaping, but can let you turn off its bidi reordering. (PuTTY can do
> that, but it's for logging from Windows into Unix systems, so AFAIK
> will not run natively on Posix hosts.)
>
> You see, Emacs supports Arabic shaping by using a shaping engine
> (a.k.a. "font backend") that works with OTF/TTF fonts, which know what
> glyphs are needed to represent a correctly-shaped Arabic letter or
> ligature composed from certain codepoints. But this only works on GUI
> frames, because on text-mode frames, Emacs just writes the codes of
> the characters to the terminal driver, it cannot specify font glyphs
> to display those characters.
>
> As you have discovered, disabling bidi-display-reordering is not the
> solution, because there's much more to bidi editing support in Emacs
> than just reordering characters for display. That is why we need
> bidi-aware display engine in Emacs in the first place, and cannot rely
> on external solutions like what exists in Pango etc., or in terminal
> emulators, for that matter.
>
> If BiCon can let you disable its reordering, and still perform
> shaping, then that's your solution. If it doesn't, then maybe asking
> its developers to provide such a feature, or coding it yourself, is
> the way forward for you and other Arabic-speaking users of text-mode
> frames in Emacs.
>
> Bottom line: this isn't a bug in Emacs, this is how the code was
> designed and supposed to work on TTY frames.
>
> Of course, if someone knows a way to communicate character shaping to
> a terminal driver, we could think of implementing that in Emacs. But
> does such a protocol exist?
>
> Thanks.
>
[-- Attachment #2: Type: text/html, Size: 3860 bytes --]
next prev parent reply other threads:[~2018-08-24 22:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-23 21:06 bug#32516: 26.1; Reshape Arabic Characters in the Terminal Naheel Azawy
2018-08-24 6:28 ` Eli Zaretskii
2018-08-24 22:25 ` Naheel Azawy [this message]
2018-08-25 7:03 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJr1c0LOzccnrf60O5-6p+v+SzK9=Yr3qKcrcRTDqBzKTaxECA@mail.gmail.com' \
--to=naheelazawy@gmail.com \
--cc=32516@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).