unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: hossein valizadeh <valizadeh.ho@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: pipcet@gmail.com, 41005@debbugs.gnu.org,
	Nicholas Drozd <nicholasdrozd@gmail.com>
Subject: bug#41005: problem with rendering Persian text in Emacs 27
Date: Fri, 5 Jun 2020 17:02:55 +0430	[thread overview]
Message-ID: <CAMyfNNomdkgdFzB5EH1znwNoFrtyXfD1KV=gRW8YstP7rEQJFw@mail.gmail.com> (raw)
In-Reply-To: <83lfl2av8z.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 4384 bytes --]

> Please tell which patch was that, and in what Emacs version you tried
> it.  (Please understand that you are generally talking to people some
> of whom don't read Arabic or Persian, so the more details you supply
> the less misunderstanding and confusion will follow, and the faster
> this problem will be solved.)

I'm sorry, my English is so bad, at least in writing. That's why it's
hard for me to give a full explanation.
My Emacs version:  27.0.91
I applied this patch:

diff --git a/src/hbfont.c b/src/hbfont.c
index 576c5fe..4b3f64e 100644
--- a/src/hbfont.c
+++ b/src/hbfont.c
@@ -26,6 +26,7 @@
 #include "composite.h"
 #include "font.h"
 #include "dispextern.h"
+#include "buffer.h"

 #ifdef HAVE_NTGUI

@@ -438,7 +439,11 @@ hbfont_shape (Lisp_Object lgstring, Lisp_Object
direction)

   /* If the caller didn't provide a meaningful DIRECTION, let HarfBuzz
      guess it. */
-  if (!NILP (direction))
+  if (!NILP (direction)
+      /* If they bind bidi-display-reordering to nil, the DIRECTION
+        they provide is meaningless, and we should let HarfBuzz guess
+        the real direction.  */
+      && !NILP (BVAR (current_buffer, bidi_display_reordering)))
     {
       hb_direction_t dir = HB_DIRECTION_LTR;
       if (EQ (direction, QL2R))

--------------------------------------------------------------------------------
> I cannot play this on my system, I see a bunch of ads (or what looks
> like ads), and the name of a .mkv file.

video file reuploaded (.mp4 and .ogg):
https://srv-file9.gofile.io/download/cz7P41/out.mp4
https://srv-file4.gofile.io/download/Mwv8k4/out.ogg
--------------------------------------------------------------------------------

This patch solved the problems of eww, newsticker, (and possibly some
other major modes) in displaying Persian/Arabic words. However, if one
of the auto-fill-mode or column-number-mode is enabled, there is still
the same problem in files that use Persian or Arabic characters.
Especially when you want to go back a few characters in a line and add
something to that line.

--------------------------------------------------------------------------------
> Please tell the codepoint of each character you type to reproduce
> the problem and each Emacs command.

For example, if you type in the following sentence:
این نام است که می‌ماند

codepoint:
\u0627\u06cc\u0646 \u0646\u0627\u0645 \u0627\u0633\u062a \u06a9\u0647
\u0645\u06cc\u200c\u0645\u0627\u0646\u062f


Then go back a few characters in the same line and type words randomly. You
will see that the letters in some words are displayed separately. I type a
few words at random, after the word این and before the word نام :‌

این فراموشی را به همه اینکه فرمت مراتب افتتاح گرامی گرایش سراسیمه نام است
که می‌ماند

codepoint:
\u0627\u06cc\u0646 \u0641\u0631\u0627\u0645\u0648\u0634\u06cc \u0631\u0627
\u0628\u0647 \u0647\u0645\u0647 \u0627\u06cc\u0646\u06a9\u0647
\u0641\u0631\u0645\u062a \u0645\u0631\u0627\u062a\u0628
\u0627\u0641\u062a\u062a\u0627\u062d \u06af\u0631\u0627\u0645\u06cc
\u06af\u0631\u0627\u06cc\u0634 \u0633\u0631\u0627\u0633\u06cc\u0645\u0647
\u0646\u0627\u0645 \u0627\u0633\u062a \u06a9\u0647
\u0645\u06cc\u200c\u0645\u0627\u0646\u062f

This line should look like this:
http://s12.picofile.com/file/8399190550/correct.png

But if one of the auto-fill-mode or column-number-mode is enabled. it will
be displayed this way:
http://s13.picofile.com/file/8399190584/malformed.png

--------------------------------------------------------------------------------
> Please show a full recipe for reproducing this, starting from
> "emacs -Q", and describing every step to reproduce the result.

All steps are displayed in the video file.

> I'd also greatly appreciate if you specifically point out at which
> parts of the display to look at what differences to pay attention
> to. This is needed to fully understand the problem and analyze its
> root cause(s), given that not all of us can read the Arabic script.

The letters that should normally be connected will be displayed separately:
http://s12.picofile.com/file/8399222618/latest_screenshot.png
--------------------------------------------------------------------------------

[-- Attachment #2: Type: text/html, Size: 5159 bytes --]

  parent reply	other threads:[~2020-06-05 12:32 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 18:02 bug#41005: problem with rendering Persian text in Emacs 27 hossein valizadeh
2020-05-01 18:51 ` Eli Zaretskii
     [not found]   ` <CAMyfNNp7FiFgAN5EVcVauawiy8ZB7U+eKY7qOeqZOnbMQfs5iQ@mail.gmail.com>
2020-06-03 14:34     ` Eli Zaretskii
2020-06-03 17:24 ` Nicholas Drozd
2020-06-03 18:01   ` Eli Zaretskii
2020-06-04  2:39     ` hossein valizadeh
2020-06-04  3:01       ` hossein valizadeh
2020-06-04  4:01         ` Eli Zaretskii
2020-06-04  4:10           ` Eli Zaretskii
2020-06-04  6:27             ` hossein valizadeh
2020-06-04  8:28               ` Pip Cet
2020-06-04 13:15                 ` Eli Zaretskii
2020-06-04 19:52                   ` Pip Cet
2020-06-05  4:46                     ` hossein valizadeh
2020-06-05  6:21                       ` Eli Zaretskii
2020-06-05 11:07                         ` Basil L. Contovounesios
2020-06-05 12:32                         ` hossein valizadeh [this message]
2020-06-05 12:53                           ` Eli Zaretskii
2020-06-05 13:05                             ` Pip Cet
2020-06-05 14:13                               ` Eli Zaretskii
2020-06-06  8:38                                 ` Pip Cet
2020-06-06  9:04                                   ` Eli Zaretskii
2020-06-06  9:11                                     ` Pip Cet
2020-06-06  9:24                                       ` Eli Zaretskii
2020-06-06 13:09                                         ` Pip Cet
2020-06-05 14:23                               ` hossein valizadeh
2020-06-05 14:25                                 ` Eli Zaretskii
2020-06-05  6:39                       ` Pip Cet
2020-06-05  8:01                     ` Eli Zaretskii
2020-06-05  8:41                       ` Pip Cet
2020-06-05 11:42                         ` Eli Zaretskii
2020-07-21 12:40                           ` Amin Bandali
2020-07-21 13:34                             ` Robert Pluim
2020-07-21 17:53                               ` Amin Bandali
2020-07-21 18:27                                 ` Eli Zaretskii
2020-07-22  2:12                                   ` Amin Bandali
2020-07-22 14:20                                     ` Eli Zaretskii
2020-07-24  4:11                                       ` Amin Bandali
2020-07-24  6:09                                         ` Eli Zaretskii
2020-07-25  4:19                                           ` Amin Bandali
2020-07-25  6:48                                             ` Eli Zaretskii
2020-07-25 15:53                                               ` Amin Bandali
2020-07-25 16:28                                                 ` Eli Zaretskii
2020-07-25 16:44                                                   ` Amin Bandali
2020-07-25 16:56                                                     ` 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='CAMyfNNomdkgdFzB5EH1znwNoFrtyXfD1KV=gRW8YstP7rEQJFw@mail.gmail.com' \
    --to=valizadeh.ho@gmail.com \
    --cc=41005@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=nicholasdrozd@gmail.com \
    --cc=pipcet@gmail.com \
    /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).