Guardian Programmer's Guide

Table Of Contents
Communicating With Printers
Guardian Programmer’s Guide 421922-014
11 - 18
Printing Text
Refer to the appropriate printer reference manual for a complete list of possible values
for each of these escape sequences. The following example describes a font for the
Courier typeface, with the ASCII symbol set, fixed spacing, 10 characters per inch,
12 point, upright, bold, in portrait orientation:
SBUFFER ':=' [%33,"(s3T",%33,"(0U",%33,"(s0P",%33,"(s10H",
%33,"(s12V",%33,"(s0S",%33,"(s3B",
%33,"&l0O"] -> @S^PTR;
CALL WRITEX(PRINTER^NUM,
SBUFFER,
@S^PTR '-' @SBUFFER);
IF <> THEN ...
Underlining Text
To underline text, write an escape sequence in the following format to the printer:
All text following the underline escape sequence is printed underlined up to the escape
sequence that turns off underlining. By default, underlining is turned off.
position specifies where the line is drawn with respect to the text. position can
have two values:
The following code fragment shows an example for a Tandem laser printer. It uses
floating position underlining:
STRING .START^UNDER[0:4] := [%33,"&d3D"];
STRING .STOP^UNDER[0:3] := [%33,"&d@"];
.
!Send the start-underlining escape sequence:
CALL WRITEX(PRINTER^NUM,START^UNDER,$LEN(START^UNDER));
IF <> THEN ...
!Send the text to be printed underlined:
SBUFFER ':=' "This is underlined text," -> @S^PTR;
CALL WRITEX(PRINTER^NUM,SBUFFER,@S^PTR '-' @SBUFFER);
IF <> THEN ...
!Send the stop-underlining escape sequence:
CALL WRITEX(PRINTER^NUM,STOP^UNDER,STOP^UNDER);
IF <> THEN ...
Escape sequence for underlining text:
esc&dpositionD
Escape sequence to turn off underlining:
esc&d@
0 Fixed position; always the same distance below the line of text
3 Floating position; depends on the underline distance of all fonts printed on the
current line