unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <83y2p1a91g.fsf@gnu.org> (raw)
In-Reply-To: <jwvpnadsjjn.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Fri, 05 Jun 2020 09:58:57 -0400)

> 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.



  reply	other threads:[~2020-06-05 14:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200605075722.16213.57047@vcs0.savannah.gnu.org>
     [not found] ` <20200605075724.3C52120A26@vcs0.savannah.gnu.org>
2020-06-05 13:58   ` emacs-27 30a7ee5: Fix Arabic shaping when eww/shr fill the text to be rendered Stefan Monnier
2020-06-05 14:20     ` Eli Zaretskii [this message]
2020-06-05 15:20       ` Stefan Monnier

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=83y2p1a91g.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).