Thomas Dickey writes:
> no - storing the attributes+color in the same 32-bit word limits us to
> 16-bit characters. OSF1/.../Tru64 uses a struct, which looks like the
> only way to do this within the X/Open spec. I'm considering making
> macros that hide the difference and adding configuration to generate
> wide- and normal libraries.
Is there any reason to do things differently than in the X/Open spec?
That spec is based on the cchar_t type, which contains the information
about one screen cell (or two adjacent cells, in case of a
double-width character). It must contain the base character,
additional combining characters - how else could you display Thai? -
and of course a foreground and a background color.
It's not worth discussing the number of bits needed to represent a
screen cell. The entire screen will normally be less than 132x50
cells. It won't a big difference to programs whether that uses 3 KB or
15 KB.
The hard thing is that, according to the spec, you can use a simple
'char' in one cell and a 'cchar_t' in the next one. This implies
conversion between 'char' and 'wchar_t' which you may want to avoid in
the normal (char-only) library.
Bruno
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/