Bidi paragraph direction in terminal emulators

Richard Wordingham via Unicode unicode at
Fri Feb 8 18:18:14 CST 2019

On Sat, 09 Feb 2019 00:16:30 +0200
Eli Zaretskii via Unicode <unicode at> wrote:

> > Date: Fri, 8 Feb 2019 21:55:58 +0000
> > From: Richard Wordingham via Unicode <unicode at>

> > I will give a concrete application.  If I want to make a font that
> > is interpretable for Tai Tham and maximally usable with VTE, what
> > are the VTE-specific constraints for me to be able to use it for
> > Tai Tham when using basic text utilities?  For example, if VTE
> > decides that for <cons, left-matra, above-matra> as two clusters
> > <cons> and <left-matra, above-matra>, can I nevertheless position
> > the above-matra above the <cons>?  

> For character composition, you must have a shaping engine to talk to,
> and the shaper should tell you the width of each grapheme cluster it
> returns.

(a) What defines the grapheme clusters?  The definition might be

(b) With a terminal that expects a fixed width font, surely the
terminal decides how many cells it allocates to a group of characters,
and the font designer has to come up with a suitable value based on

>  I don't see how you can expect wcwidth, or any other
> interface that was designed to work with _characters_, to be useful
> when you need to display grapheme clusters.

Well I can envisage a decision being made that a grapheme cluster str
(as decreed by the terminal) shall occupy wcswidth(str) cells - "The
wcswidth() function returns the number of column positions for the
wide-character string s, truncated to at most length n".


More information about the Unicode mailing list