Control sequences in printer parameter files

Most sections of the printer parameter file require control sequences, the format of which differs according to the print manager type in use. This is defined in Section 2, Entry 2 of the printer parameter file, as S (Sculptor print manager) W (Windows print manager) or R (Rich Text Format print manager).


Sculptor print manager

Control sequences consist of a list of character codes separated by commas. Character codes are the characters, both printable and unprintable, which are represented by the values 0 to 255 in the ASCII character set.

Each code in a control sequence may be entered in a variety of formats, and the formats available may be freely mixed within a single sequence. The method chosen generally follows the format used in the printer’s manual. All the formats listed below are found in various manuals.

Printable characters

A printable character (codes 32 to 126) may normally be represented by the character itself. The exceptions to this are the space character, and the comma character, for which the mnemonics SPC and COMMA should be used.

Unprintable characters

There are a number of different formats available for specifying unprintable characters. For any character, the hexadecimal or decimal value of its ASCII number may be provided. Certain keys may be also defined by control codes or by special mnemonics.

Format

Meaning

^X

Control code. Specifies the code CTRL X, which is produced by holding down the CONTROL key and pressing the key X at the same time. There are a total of 32 control codes: ^@, ^A to ^Z, ^[, ^\, ^], ^^ and ^_.

$x

Hexadecimal value. The code which has the hexadecimal value x, where x is one or more hexadecimal digits (e.g. $0d, $ff).

#n

Decimal value. The code which has the decimal value n where n is one or more decimal digits (e.g. #90, #108).

Mnemonics

The control codes with the ASCII values 0-31 (hex 00-1f) have a set of fairly standardised mnemonics (beginning with (NUL, SOH, STX…), which are listed in The ASCII character set table. These mnemonics may be used as character codes for the characters they represent.

The following additional mnemonics are available:

ESC

The escape character (#27, $1b)

SPC

The space character (#32, $20)

COMMA

The comma character (#44, $2c)

DEL

The DEL character (#127, $7f)

PAD n

Specifies n null characters where n is a number in the range 1-255. There must be a space between PAD and n.

DELAY n

Specifies a delay of at least 10 * n milliseconds where n is a number in the range 1-255. There must be a space between DELAY and n.

The following two mnemonics must always be used, as ordinary quote marks are rejected by the compiler (see Quoted strings below):

DQUOTE

The double quote character (#34, $22).

SQUOTE

The single quote character (#39, $27).

Quoted strings

Quoted strings, either in double or single quotes, may be used in control sequences. Therefore, if the actual single quote ( ’ ) or double quote ( ” ) character is required in a control sequence, the relevant mnemonic (SQUOTE or DQUOTE) must be used.


Windows print manager

Raw escape sequences cannot be used in printer parameter files intended for use under Windows.

A control sequence for Windows consists of a text string in one of the following formats:

font_family

font_family, style

font_family@size

font_family, style@size

“,*style*”

“@*size*”

“,*style*@size

The font_family is the font family name, such as “courier”, or “helvetica”. If the requested font is not available on the system, the default is used.

The size is the size in points, e.g. 10, 12. If this is not stated, a default is used.

The style may be any one of the following:

None

Normal (default)

b

Bold

i

Italic

u

Underline

o

Outline

s

Shadow

v

Inverse

l

Blink

t

Strikeout

The following example:

Double width = “courier,b@24”

defines the standard control sequence for printing double width (PSC_DOUBLE_WIDTH) as courier font, bold, 24 point. Standard control sequences are defined in Section 3 of the printer parameter file.

Note

Sequences with special definitions such as the Width and Length entries in Section 3 use the usual form.


Rich text format print manager

The rich text format parameter file winrtf.s contains the codes used to generate effects such as “start underline” in a Microsoft rich text file. The same codes are used by all programs which accept rich text files (e.g. WordPad, Word). Apart from the text strings in Section 1, there is no need to amend the file winrtf.s other than to add codes which are not currently there. See your Microsoft documentation for further information.


RELATED TOPICS

Printer parameter files

The include file <printer.h>

The ASCII character set