[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wadd_wch() operates on wrong coords for non-spacing chars
From: |
Thomas Dickey |
Subject: |
Re: wadd_wch() operates on wrong coords for non-spacing chars |
Date: |
Thu, 6 Jul 2023 04:14:12 -0400 |
On Wed, Jul 05, 2023 at 10:21:55PM -0400, Bill Gray wrote:
> On 7/5/23 19:41, Thomas Dickey wrote:
> > On Wed, Jul 05, 2023 at 09:51:32PM +0200, Roman Zilka wrote:
> > > Hello,
> > >
> > > according to curs_add_wch(3x) add_wch() adds non-spacing characters to
> > > the base character on the current coordinates. Therefore, the
> > > following program should print "aáa". It prints "áaa", however.
> >
> > thanks - I can reproduce this, will investigate
>
> More simply, addwstr( L"a\u0301aa"); will emit áaa, not aáa. So does
I read the example as
addwstr( L"aa\u0301a");
and did not recall whether add_wch called addch (checking the source, I see
that it updates the cells directly). If it did that, then the move()
calls could interfere with the process (see man addch).
But the move() calls are probably relevant - something to see on Saturday.
> wprintf( "La\u0301aa"). I noticed this some years back and assumed it was
> supposed to be that way: the combining character modifies the preceding
> character. A bit of Web searching suggests that's the way it's supposed to
> work; to get á, you emit a and then \u0301, not \u0301 and then a.
>
> Seen from that angle, Roman's program is working correctly;
>
> move(0, 1); add_wch(&ccmod);
>
> says "add an accent to the character just to the left of (0, 1)."
> However, I have to admit that the man page description, I think, supports
> Roman's expected behavior.
>
> I would find it annoying to use \u0301aaa for curses and a\u0301aa for
> everything else.
>
> Are there any implementations of curses other than ncurses and
> PDCursesMod that handle combining characters? (I copied the ncurses
> behavior for PDCursesMod, so that's not independent support for the ncurses
> behavior.)
Solaris' X/Open curses might - I can check that.
I seem to recall that NetBSD doesn't - but can check that.
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
signature.asc
Description: PGP signature