[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-27 30a7ee5: Fix Arabic shaping when eww/shr fill the text to b
From: |
Eli Zaretskii |
Subject: |
Re: emacs-27 30a7ee5: Fix Arabic shaping when eww/shr fill the text to be rendered |
Date: |
Fri, 05 Jun 2020 17:20:43 +0300 |
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> Date: Fri, 05 Jun 2020 09:58:57 -0400
>
> > Fix Arabic shaping when eww/shr fill the text to be rendered
> > * src/hbfont.c (hbfont_shape): Don't use DIRECTION if the current
> > buffer has bidi reordering disabled. (Bug#41005)
> [...]
> > - 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)))
>
> Hmm... so indeed I see that SHR binds `bidi-display-reordering`.
Yes, it does. But the problem is more general, so the fix is not just
a kludge to fix what shr does. As the comment explains.
> Isn't that a problem, since its docstring says:
>
> [...]
> Setting this to nil is intended for use in debugging the display code.
> [...]
It's "do like I say, not like I do" ;-)
> Can we change SHR so it doesn't bind this var?
I didn't see any better way at the time. Shr's naïve filling
algorithm cannot cope with the complexity of RTL text in an LTR
paragraph, when a long line has been continued. Maybe it's even
entirely impossible to DTRT in Lisp in these cases. But if you or
someone else have ideas, please describe them.