Bidi paragraph direction in terminal emulators

Eli Zaretskii via Unicode unicode at unicode.org
Sat Feb 9 13:13:29 CST 2019


> From: Egmont Koblinger <egmont at gmail.com>
> Date: Sat, 9 Feb 2019 20:03:21 +0100
> Cc: Richard Wordingham <richard.wordingham at ntlworld.com>, 
> 	unicode Unicode Discussion <unicode at unicode.org>
> 
> Let's suppose a utility outputs these two lines of text:
> abcdefg|
> complex|
> 
> whereas "abcdefg" are these English letters themselves, but "complex"
> is a word of some language requiring complex script rendering, taking
> up 7 logical cells (because that's what wcwidth() says). Also, "|" is
> the pipe symbol, or a vertical box drawing line, whatever.
> 
> Now let's assume that harfbuzz tells you that the desired width for
> rendering this "complex" word is 5.3 times the width of the character
> cell. Or 8.6 times it. How to proceed? How will the "|" bars align up,
> and thus mc's two-panel layout, tmux's vertical split etc. not fall
> apart?  In the latter case, when the width requested by harfbuzz is
> bigger than the designated width, what to with characters that "fall
> off" at the right edge of the terminal?

That's the application's problem, not the terminal's.  An application
that wants its column to line up _and_ wants to support complex text
scripts will need to move cursor to certain coordinates, not to assume
that 7 codepoints always take 7 columns on display.  Or it will have
to tell the users to use specific fonts, which are known to provide
guarantees that this happens.

How is this different from using variable-pitch fonts?


More information about the Unicode mailing list