[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Double column width character written wrongly after refresh

From: Mitsuru Chinen
Subject: Re: Double column width character written wrongly after refresh
Date: Mon, 2 Jun 2003 23:21:17 +0900

Thomas Dickey <address@hidden> wrote:
> I've spent about an hour looking at this, but seem to be overlooking
> something.  The gif file itself doesn't show a glitch.  However, running
> your test program, I see some overlap effect which is probably what you're
> talking about.

Excuse me for my poor explanation.
As you've already found, my source code would display the full width
'b' on the right-hand side of the full width 'a'. And there would be
no '#' between the 'a' and 'b'. But a '#' is displayed.

> Studying waddstr(), it seems that I should be able to
> use mbrlen() to detect that the 3-character string is a single multibyte
> character.  But it's returning a -2 (which says that it isn't working as
> I thought.  I'll try later on a different platform (currently using libutf8
> since this platform has some other things I needed to test).

Thank you so much for your investigation.

I suppose I found a lead to solve this defect.
At 237 line in PutAttrChar() in ./ncurses/tty/tty_updates.c, sp->_curscol
always increases by 1, even if a multi-column character is processed.
This cause the difference between sp->_curscol and curscr->_curx.
If sp->_curscol increases by wcwidth (ch->chars[0]), my sample program
(fullwidth.c) works fine.

But this solution is imperfect.
The following sample code doesn't work correctly with this solution.

This sample code would work:
  1. Write background characters '#'.
  2. Write full width characters 'abc'.
  3. Over-write a full width character 'x' on 'b'.

After 'x' is written, the displayed characters should be 'axc'.
But displayed characters are 'xbc'.
So I think there are other defects around handling character width.
But I could not find yet.

I hope this would help you.

Best Regards,
Mitsuru Chinen
// AP Linux Technology Center, 
// Yamato Software Lab., SWG, IBM;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]