terminfo.4 (2010 09)

t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
Alternate Character Sets
scs Select character set N
scsd Start definition of character set N, M characters
defc Define character A, B dots wide, descender D
rcsd End definition of character set N
csnm List of character set names
daisy Printer has manually changed print-wheels
The scs, rcsd, and csnm strings are used with a single argument, N, a number from 0 to 63 that
identifies the character set. The scsd string is also used with the argument N and another, M, that
gives the number of characters in the set. The defc string is used with three arguments: A gives the
ASCII code representation for the character, B gives the width of the character in dots, and D is zero or
one depending on whether the character is a "descender" or not. The defc string is also followed by a
string of "image-data" bytes that describe how the character looks (see below).
Character set 0 is the default character set present after the printer has been initialized. Not every
printer has 64 character sets, of course; using scs with an argument that doesnt select an available
character set should cause a null pointer to be returned by tparm() (see tigetflag(3X)).
If a character set has to be defined before it can be used, the scsd control sequence is to be used before
defining the character set, and the rcsd is to be used after. They should also cause a NULL pointer to
be returned by tparm() when used with an argument N that doesnt apply. If a character set still has to
be selected after being defined, the scs control sequence should follow the rcsd control sequence. By
examining the results of using each of the scs, scsd, and rcsd strings with a character set number in
a call to tparm(), a program can determine which of the three are needed.
Between use of the scsd and rcsd strings, the defc string should be used to define each character. To
print any character on printers covered by terminfo, the ASCII code is sent to the printer. This is true
for characters in an alternate set as well as "normal" characters. Thus the definition of a character
includes the ASCII code that represents it. In addition, the width of the character in dots is given, along
with an indication of whether the character should descend below the print line (such as the lower case
letter "g" in most character sets). The width of the character in dots also indicates the number of image-
data bytes that will follow the defc string. These image-data bytes indicate where in a dot-matrix pat-
tern ink should be applied to "draw" the character; the number of these bytes and their form are defined
in the Dot-Matrix Graphics section below.
It’s easiest for the creator of terminfo entries to refer to each character set by number; however, these
numbers will be meaningless to the application developer. The csnm string alleviates this problem by
providing names for each number.
When used with a character set number in a call to tparm(), the csnm string will produce the
equivalent name. These names should be used as a reference only. No naming convention is implied,
although anyone who creates a terminfo entry for a printer should use names consistent with the
names found in user documents for the printer. Application developers should allow a user to specify a
character set by number (leaving it up to the user to examine the csnm string to determine the correct
number), or by name, where the application examines the csnm string to determine the corresponding
character set number.
These capabilities are likely to be used only with dot-matrix printers. If they are not available, the
strings should not be defined. For printers that have manually changed print-wheels or font cartridges,
the boolean daisy is set.
Dot-Matrix Graphics
Dot-matrix printers typically have the capability of reproducing raster graphics images. Three numeric
capabilities and three string capabilities help a program draw raster-graphics images independent of the
type of dot-matrix printer or the number of pins or dots the printer can handle at one time.
HP-UX 11i Version 3: September 2010 33 Hewlett-Packard Company 33