Previous Next Chapter

Standard ANSI Escape Sequences

The following is a list of standard ANSI printer escape sequences for typical dot matrix printer text features:

Feature

Escape Sequence

Name

Reset printer

Escc

aRIS

Initialize printer

Esc#1

aRIN

Line feed

EscD

aIND

Return line feed

EscE

aNEL

Reverse line feed

EscM

aRI

Normal character set

Esc[0m

aSGR0

Italics on

Esc[3m

aSGR3

Italics off

Esc[23m

aSGR23

Underline on

Esc[4m

aSGR4

Underline off

Esc[24m

aSGR24

Boldface on

Esc[1m

aSGR1

Boldface off

Esc[22m

aSGR22

Set foreground color

Esc[30m to Esc[39m

aSFC

Set background color

Esc[40m to Esc[49m

aSBC

Normal pitch

Esc[0w

aSHORP0

Elite pitch on

Esc[2w

aSHORP

Elite pitch off

Esc[1w

aSHORP1

Condensed fine pitch on

Esc[4w

aSHORP4

Condensed off

Esc[3w

aSHORP3

Enlarged pitch on

Esc[6w

aSHORP6

Enlarged pitch off

Esc[5w

aSHORP5

Shadow print on

Esc[6"z

aDEN6

Shadow print off

Esc[5"z

aDEN5

Doublestrike on

Esc[4"z

aDEN4

Doublestrike off

Esc[3"z

aDEN3

Near Letter Quality on

Esc[2"z

aDEN2

Near Letter Quality off

Esc[1"z

aDEN1

Superscript on

Esc[2v

ASUS2

Superscript off

Esc[1v

aSUS1

Subscript on

Esc[4v

aSUS4

Subscript off

Esc[3v

aSUS3

Normalize the line

Esc[0v

aSUS0

Partial line up

Esc1

aPLU

Partial line down

EscK

aPLD

US character set

Esc(B

aFNT0

French character set

Esc(R

aFNT1

German character set

Esc(K

aFNT2

UK character set

Esc(A

aFNT3

Danish I character set

Esc(E

aFNT4

Swedish character set

Esc(H

aFNT5

Italian character set

Esc(Y

aFNT6

Spanish character set

Esc(Z

aFNT7

Top Previous Next Chapter