All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

print-text Function

Summary

Prints plain text to a printer.

Package

capi

Signature

print-text line-function &key printer tab-spacing interactive font

Arguments
line-function
A function.
printer
A printer or nil.
tab-spacing
A positive integer or nil.
interactive
A boolean.
font
A font or a font-description, or nil.
Description

The function print-text prints plain text to a printer specified by printer, and defaulting to the current printer.

line-function is called repeatedly with no arguments to enumerate the lines of text. It should return nil when the text is exhausted.

tab-spacing, which defaults to 8, specifies the number of spaces printed when a tab character is encountered.

print-text starts a new page when a line consisting of just a formfeed character (ASCII 12) is found in the text.

If interactive is t, then a print dialog is displayed. This is the default behavior.

font should be a gp:font object, or a Font Description object, or a symbol which is a font alias as defined by define-font-alias. The printed text is line wrapped on the assumption that the font is fixed width, so be sure to pass a suitable font. The default value of font is a Font Description for a fixed pitch font of size 10.

See also

print-editor-buffer
print-file
16 Printing from the CAPI—the Hardcopy API


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42