bug-ncurses
[Top][All Lists]
Advanced

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

Re: Converting cchar_t to wchar_t


From: Bryan Christ
Subject: Re: Converting cchar_t to wchar_t
Date: Mon, 17 Jun 2019 14:27:15 -0500

That makes sense.  I think A_ALTCHARSET is now giving me problems and I might give your approach a shot.

On Fri, Jun 14, 2019 at 1:34 PM Mike Gran <address@hidden> wrote:
On Fri, Jun 14, 2019 at 01:28:12PM -0500, Bryan Christ wrote:
> Ya.  I realized that I could use getcchar() and setcchar() to handle the
> conversion.  The root of my problem is that Mac OS appears to handle this
> code...
>
> wattr_set(vterm->window, attrs, colors, NULL);
> mvwadd_wch(vterm->window, r, c, &vcell->uch);
>
> ...slightly different on FreeBSD and Linux when the attributes in cchar_t
> (in this case vcell->uch) are not set.  On FreeBSD and Linux the attrs from
> the wattr_set() are honored in the final render.  On Mac OS, the cchar_t
> members attr and ext_colors appear to trump the other during the final
> render--effectively rendering them not visible.  There may be more to this
> than meets the eye, but specifically syncing them up with setcchar() solves
> the problem.

In my code, after calling getcchar, I have the following line, which
may be relevant, that helps disambiguate attributes from color params.

  /* Strip the color info from attr */
  attr &= A_ATTRIBUTES ^ A_COLOR;

When reassembling using setcchar, you don't need any of this, I believe.

Regards,
Mike Gran



--
Bryan
<><

reply via email to

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