Subject: bug#41005: problem with rendering Persian text in Emacs 27

From: Eli Zaretskii <[email-masked]>
Date: Sat, 06 Jun 2020 12:24:54 +0300

> From: Pip Cet <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Sat, 06 Jun 2020 09:11:36 +0000
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> From: Pip Cet <[email-masked]>
> >> Cc: [email-masked],  [email-masked],  [email-masked]
> >> Date: Sat, 06 Jun 2020 08:38:39 +0000
> >> 
> >> >> Given these two bugs, I wonder whether it wouldn't be more reasonable
> >> >> always to let HarfBuzz guess the direction, at least for Emacs-27:
>                                                   ~~~~~~~~~~~~~~~~~~~~~
> 
> I should have been clearer here and said I was only concerned with Emacs 27.

Ah, okay.  That settles some of the misunderstanding.

But even in emacs-27, I think passing the right direction where we
know it is better.  For example, the use case with directional
override is only problematic in emacs-27 if the following conditions
are both true:

  . the same sequence of characters is used elsewhere, but without the
    override
  . the font glyphs produced by the shaper are different for different
    directions

The first is somewhat likely to happen, but the second happens only
for some specific scripts, such as Arabic (again, if we consider the
scope of what is supported well by Emacs 27, which, for example,
excludes ligatures).

And the use case with directional overrides is itself very rare.  The
more frequent use cases which hit on this deficiency in emacs-27 are
those which you just fixed on emacs-27, and the fix is indeed to let
HarfBuzz guess.