HP-UX Reference (11i v1 05/09) - 4 File Formats (vol 8)
t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
Changing the Character/Line Pitches
cpi Change character pitch
cpix If set, cpi changes spinh
lpi Change line pitch
lpix If set, lpi changes spinv
Programs that use cpi or lpi should recalculate the dot spacing:
Effects of Changing the Character/Line Pitches
Before After
Using cpi with cpix clear:
spinh’ spinh
Using cpi with cpix set:
spinh’ spinh = spinh’ * orhi / orhi’
Using lpi with lpix clear:
spinv’ spinv
Using lpi with lpix set:
spinv’ spinv = spinv’ * orhi / orhi’
Using chr:
spinh’ spinh
Using cvr:
spinv’ spinv
orhi’ and orhi are the values of the horizontal resolution in steps per inch, before using cpi and after
using cpi, respectively. Likewise, orvi’ and orvi are the values of the vertical resolution in steps per
inch, before using lpi and after using lpi, respectively. Thus, the changes in the dots per inch for dot-
matrix graphics follow the changes in steps per inch for printer resolution.
Print Quality
Many dot-matrix printers can alter the dot spacing of printed text to produce near-letter-quality printing
or draft-quality printing. It is important to be able to choose one or the other because the rate of printing
generally decreases as the quality improves. Three strings describe these capabilities:
Print Quality
snlq Set near-letter quality print
snrmq Set normal quality print
sdrfq Set draft quality print
The capabilities are listed in decreasing levels of quality. If a printer doesn’t have all three levels, the
respective strings should be left blank.
Printing Rate and Buffer Size
Because there is no standard protocol that can be used to keep a program synchronized with a printer, and
because modern printers can buffer data before printing it, a program generally cannot determine at any
time what has been printed. Two numeric capabilities can help a program estimate what has been printed.
Print Rate/Buffer Size
cps Nominal print rate in characters per second
bufsz Buffer capacity in characters
cps is the nominal or average rate at which the printer prints characters; if this value is not given, the rate
should be estimated at one-tenth the prevailing baud rate. bufsz is the maximum number of subsequent
characters buffered before the guaranteed printing of an earlier character, assuming proper flow control
has been used. If this value is not given it is assumed that the printer does not buffer characters, but
prints them as they are received.
As an example, if a printer has a 1000-character buffer, then sending the letter "a" followed by 1000 addi-
tional characters is guaranteed to cause the letter "a" to print. If the same printer prints at the rate of 100
characters per second, then it should take 10 seconds to print all the characters in the buffer, less if the
buffer is not full. By keeping track of the characters sent to a printer, and knowing the print rate and
buffer size, a program can synchronize itself with the printer.
Note that most printer manufacturers advertise the maximum print rate, not the nominal print rate. A
good way to get a value to put in for cps is to generate a few pages of text, count the number of printable
characters, and then see how long it takes to print the text.
Section 4−−358 Hewlett-Packard Company − 32 − HP-UX 11i Version 1: September 2005