Line wrapping of mixed LTR/RTL text

Eli Zaretskii via Unicode unicode at unicode.org
Tue Aug 28 13:48:10 CDT 2018


> From: Cosmin Apreutesei <cosmin.apreutesei at gmail.com>
> Date: Tue, 28 Aug 2018 21:28:58 +0300
> Cc: unicode at unicode.org
> 
> > That is not so if the line ends after the whitespace: in that case the
> > whitespace is trailing, and will appear at the visual end of the
> > line.
> 
> So only if it's a soft break I should indeed remove the last logical
> space, if it's before a hard break then leave it alone.

Actually, you don't have to remove it, you could leave it.  It's only
an aesthetic issue.

> > No, it should show the space after ABC to the left of ABC,
> > i.e. immediately before the line end.
> 
> Just to make sure, this moving of the last space at the visual end of
> the line can only be experienced with a moving cursor, right? I mean
> as far as displaying goes (and as far as line width computation for
> the purposes of line wrapping goes), that space is just removed,
> right?

As I said, not necessarily.  But it is definitely there when you
reorder characters for display.

> I'm trying to infer the purpose of moving that space to the
> end of the line instead of just removing it

If you remove trailing space, then you need to see it being trailing
before you remove it.  That is the purpose of moving it.

> > What UAX#9 tells you is that you need to decide that the line will
> > wrap after the space that follows "ABC"
> 
> ... but when computing the line width I should not include the width
> of that space, right? since it will not take space in the box in the
> end.

If you will remove the space, then yes.

> You mean it will produce this:
> 
> " ABC لمفاتيح"

Yes.


More information about the Unicode mailing list