Subject: Re: bug#42562: Problem with rendering Persian text still exists in minibuffer and dired

From: Eli Zaretskii <[email-masked]>
Date: Fri, 31 Jul 2020 15:56:24 +0300

> From: Sineau Gh <[email-masked]>
> Date: Fri, 31 Jul 2020 11:02:44 +0430
> Cc: [email-masked]
> 

> تحقیق
> تست
> مدرن.txt
> تحقیق.org

> - visit a file using C-x C-f.
> - use TAB for *Completion Buffer*.
> - first character of all file names are disjointed.
> - type ت to filter the filenames, now the second characters are
>   disjointed.
> - now open one of the files. in modeline first and last characters of
>   the filename are disjointed.

Thanks.  Now everything is clear: this is due to the basic limitation
of how Emacs displays text with different faces: we render each run of
character in the same face separately from characters in a different
face.  So if the face changes in the middle of a word, we render the
two parts of the word separately, and that breaks Arabic shaping.

Fixing this would need significant changes in the low-level code that
handles text layout, which is one of the basics of the current display
engine.  Patches are welcome.