#ANSI Graphics on Rainbow
16-Aug-90 12:16:05
Sb: #21238-#ANSI Graphics on Rainbow
Fm: Bill Mayhew [VAX/DECPC] 76702,502
To: brian treadway 76116,3711
Brian,
Just for the record, and apropos of your note a few days ago inquiring
about ANSI character-set switching…
The "special character/line drawing set" *can* be set up to map to
*either* the 0-to-127 range, OR the 128-to-255 range.
Here's how it works.
The machine (Rainbow, VT2xx, VT3xx, etc.) has several character sets
on-board. Some machines also support downloadable soft character sets. In
total, these add up to way more than 256 characters, but it's not practical
to have to send two bytes to generate each character on the screen, so one
really wants a way of generating any arbitrary character with one byte.
ANSI handles this by dividing the 0-to-255 space into two "halves",
called GL and GR (0-to-127 and 128-to-255 respectively). In addition,
there can be as many as four concurrently-available character sets,
designated as G0, G1, G2, and G3; each character set holds 128 symbols.
ANSI commands exist to map one of the potentially-many on-board or soft
character sets to G0, G1, G2, or G3. For instance, ESC ( B maps the normal
ASCII set to G0; ESC ) B maps it to G1; ESC * B to G2, and ESC + B to G3.
Replace the "B" with a "<" and you can assign the DEC Supplemental (DEC
multinational) character set to one of the four available sets. "0"
instead of "B" maps the "DEC special graphics" (line-drawing) character
set. And some machines have a variety of national character sets (British,
Swiss, etc.) that can be similarly mapped.
From this set of 4 currently-available sets, one can assign two as
"active": one to GL, one to GR. The single-byte SI (octal 16, I think)
maps G0 to GL. SO (octal 17) maps G1 to GL. ESC ~ maps G1 to GR, ESC } maps
G2 to GR, ESC | maps G3 to GR… and there are other sequences for the
other combinations.
So the right sequence of sequences can give you just about any character
set in *either* (or both!) of GL and GR, under software control.
-Bill
P.S. Much of the above is based on the VT200 series. The Rainbow
probably doesn't have as many sets and may not support G2 and G3… I'm not
sure.