Re: Graphical ideas for *bands



On 2007-04-28 01:57:51, Leon Marrick <none@xxxxxxxxxxx> wrote:

Kenneth 'Bessarion' Boyd wrote:
On 2007-04-25 22:45:02, Leon Marrick wrote:

1. Colored ASCII artwork using customized extended fonts
2. The existing 2D bitmapped graphics, presented more intelligently
3. Any of several diffent kinds of isometric views

Customized extended fonts (and UNICODE) are interesting...as long as you can
work with at most two colors/cell. Some facilities for "color arithmetic" are
also in order. [E.g...being able to use the background color of the floor
against the foreground color of the monster; cf. Crawl Stone Soup for similar
ideas.]

Hmm. I'm embarrassed to say that this reply is totally Greek to me.
:-/ Can you point to a picture or two so I can understand what you
mean? Or, failing that, post some test code so I can look at what it
does? Or, failing both, explain in more detail?

The XOpen curses specification (at this time, the only extant one that even
admits being UNICODE-aware) only allows two colors to be specified for a color
pair via the init_pair function: foreground and background. In turn, when
formatting a character, the color of the character is specified with a color
pair. E.g. (code examples pulled from from my internal library with typedef
stripped; Boost-licensed should that matter to anyone):

inline chtype
format_char(unsigned short x,chtype flags,unsigned char color)
{ return (chtype)x | flags | COLOR_PAIR(color); }

I like the following as a clean "bootstrap" of the color pairs when starting up
a curses application:

if (COLORS*COLORS<=COLOR_PAIRS)
{ // full enumeration possible, go for it
// white on black hard-coded as 0, this dictates ordering
unsigned int Idx = COLOR_PAIRS;
do {
--Idx;
init_pair(Idx,(COLORS-1)-(Idx%COLORS),Idx/COLORS);
}
while(1<Idx);
}

This permits directly extracting both the foreground and background color
indexes from a color pair (by modulo arithmetic) without going through the
curses library.

Now, assuming a UNICODE-aware implementation of curses, and the availability of
a reasonable font, it would be possible to render the not-equal sign
(hexadecimal coding 2260h, HTML numeric entity &#8800; character entity &ne;) in
any supported foreground/background color choice.

What is not possible, is to superimpose the virgule and equals sign (using
combining characters) to create a trichromatic not-equal sign. Only one color
pair is allowed per logical character.

Simple application, say for a Z-style casino:
* observe that the six-sided die faces have their own UNICODE characters (on the
Misc Symbols code page, 2680h-2685h). Once we have a suitable font loaded, we
can show the actual dice results "graphically" -- in a curses console.
.



Relevant Pages

  • Re: Replacing fonts -- double-byte vs. single-byte
    ... First, in PPT 2003 and 2007, if I set text in MS Arial Unicode, then try ... the character. ... type of encoding to point to the right character info in a font. ...
    (microsoft.public.powerpoint)
  • Re: Replacing fonts -- double-byte vs. single-byte
    ... First, in PPT 2003 and 2007, if I set text in MS Arial Unicode, then try to do ... This is probably way oversimplified, but in Unicode, every character is a two ... type of encoding to point to the right character info in a font. ...
    (microsoft.public.powerpoint)
  • Re: English versus German
    ... The point is that the way TeX does it doesn't require Unicode, ... I don't know of a simple way to get both accents on the same character ... Presumably you could also assign a keyboard shortcut to it in Word2003 ... font from Cambria to MS Reference Sans Serif, and now, everything I ...
    (sci.lang)
  • Re: Diacritic accents not displaying properly
    ... You will only get the correct character in the font specified. ... Unicode will enable you to change the font for characters that are encoded ... ok, so if Times CSX+ is not unicode, then i don't understand why it worked ...
    (microsoft.public.mac.office.word)
  • Re: Fonts and character encodings
    ... Do Fonts know anything about coded character sets (Unicode, ... does Font file specify which coded character sets ... would consider a coded character set essentially equivalent to a character encoding or code page. ... you can only draw Unicode strings anyway. ...
    (microsoft.public.dotnet.languages.csharp)