Line wrapping of mixed LTR/RTL text

Cosmin Apreutesei via Unicode unicode at unicode.org
Tue Aug 28 13:28:58 CDT 2018


Hi Eli, thanks for answering! I think I'm getting closer. Just a few
more clarifications if you please.

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

> Only if you add some character after the whitespace will the
> whitespace "jump" to the other side of the word.

... because the hard break just turned into a soft break and the newly
typed character will appear on the next line with a hard line break
after it, right?

> 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?  I'm trying to infer the purpose of moving that space to the
end of the line instead of just removing it: is the idea to always
provide a cursor at the visual end of the line so that typing can
continue there or is there more to 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.

>, then reorder the line as if it
> ended after that space, which will produce this:
>
> لمفاتيح ABC
>
> (with the trailing space to the left of "ABC").  Then you should
> display "DEF" on the next line.

You mean it will produce this:

" ABC لمفاتيح"



More information about the Unicode mailing list