Grapheme clusters and east asian width
richard.wordingham at ntlworld.com
Thu Sep 17 07:27:31 CDT 2015
On Thu, 17 Sep 2015 10:00:29 +0100
Daniel Bünzli <daniel.buenzli at erratique.ch> wrote:
> Le jeudi, 17 septembre 2015 à 02:25, Richard Wordingham a écrit :
> > If you're trying to work out what a particular emulator will do, the
> > starting point is its documentation.
> Unfortunately *many* emulators.
The best estimator is probably the POSIX function wcswidth(). The
terminal emulator might actually use that function to do its layout.
Some do. If you need accuracy, you may have to resort to asking the
terminal where the cursor is. Of course the latter might not work
if only the general concept of a terminal (perhaps, better, teletype)
is being emulated. I wouldn't expect either to work for an application
being run from the emacs shell program, which works with 'proportional'
fonts, though one might get a pleasant surprise. (For example, emacs
*might* *convert* the cursor position to nominal cell widths.)
More information about the Unicode