User's Guide
D-42 Code Sets
Table D-6. Epson and IBM Escape Sequences––continued
Function ASCII Hexadecimal Decimal Description
Text Functions––continued
Automatic formatting ....... ESC a n 1B 61 n 27 97 n This sequence starts/ends automatic formatting modes,
Start centering ................ ESC a 1 1B 61 31 27 97 49 wherein the printer stores all subsequent data in a special
Start flush right ............... ESC a 2 1B 61 32 27 97 50 buffer. When the printer receives any code or sequence
Start justify ..................... ESC a 3 1B 61 33 27 97 51 that causes paper movement, it prints the stored data as
End all formatting ........... ESC a 0 1B 61 30 27 97 48 follows:
In center mode, data prints centered on the point that is
midway between the left and right margins. If a line is
too long to fit between the margins, the printer
performs line wrapping and centers each line.
In flush right mode, data prints so that the line ends at
the right margin. If a line is too long to fit, the printer
performs line wrapping and prints each line flush right.
In justify mode, data prints justified between the left
and right margins. If a line is too long to be justified,
the printer performs line wrapping and then justifies
each line. The printer does not justify any line with a
carriage return.
Proportional printing ........ ESC p n 1B 70 n 27 112 n These sequences start and end the proportional mode,
Start ................................ ESC p 1 1B 70 31 27 112 49 wherein the printer spaces characters by moving a specific
Start (alternate) ............... ESC P 1 1B 50 31 27 80 49 number of PS units, printing the character, and then
End ................................. ESC p 0 1B 70 30 27 112 48 moving by the same number of PS units again.
End (alternate) ................ ESC P 0 1B 50 30 27 80 48
If the active font is a PS font, the printer uses the PS unit
values prestored in the font. If the active font is a fixed-
pitch font, the printer uses one-half the normal character
spacing as the number of PS units for every character. All
PS fonts contain prestored PS unit values for characters.
A PS unit value represents one-half the space, in multiples
of 1/120-inch, that is required to print and space a
character. PS unit values range from 2 to 8. For example,
the letter "V" has a PS unit value of 6, so it prints centered
with a space of 12/120-inch (move 6 PS units, print the
"V", and then move 6 PS units). Or, the letter "i" has a PS
unit value of 3, so it prints centered within a space of 6/
120-inch (move 3 PS units, print the "i", and then move 3
PS units).
To determine the total distance from the center line of one
character to the center line of the next character, just add
the two characters' PS unit values. In the example above,
the distance between the center of the "V" and the center
of the "i" is 9/120-inch. All numeric characters (0 to 9)
have the same PS unit value.
After ending proportional mode, character spacing resets
to the default character spacing of the active font. If the
active font is a PS font, character spacing resets to 12
characters per inch.
Note: The ESC P n sequence is not supported when an
Epson emulation is active.
User's Guide
D-42 Code Sets
Table D-6. Epson and IBM Escape Sequences––continued
Function ASCII Hexadecimal Decimal Description
Text Functions––continued
Automatic formatting ....... ESC a n 1B 61 n 27 97 n This sequence starts/ends automatic formatting modes,
Start centering ................ ESC a 1 1B 61 31 27 97 49 wherein the printer stores all subsequent data in a special
Start flush right ............... ESC a 2 1B 61 32 27 97 50 buffer. When the printer receives any code or sequence
Start justify ..................... ESC a 3 1B 61 33 27 97 51 that causes paper movement, it prints the stored data as
End all formatting ........... ESC a 0 1B 61 30 27 97 48 follows:
In center mode, data prints centered on the point that is
midway between the left and right margins. If a line is
too long to fit between the margins, the printer
performs line wrapping and centers each line.
In flush right mode, data prints so that the line ends at
the right margin. If a line is too long to fit, the printer
performs line wrapping and prints each line flush right.
In justify mode, data prints justified between the left
and right margins. If a line is too long to be justified,
the printer performs line wrapping and then justifies
each line. The printer does not justify any line with a
carriage return.
Proportional printing ........ ESC p n 1B 70 n 27 112 n These sequences start and end the proportional mode,
Start ................................ ESC p 1 1B 70 31 27 112 49 wherein the printer spaces characters by moving a specific
Start (alternate) ............... ESC P 1 1B 50 31 27 80 49 number of PS units, printing the character, and then
End ................................. ESC p 0 1B 70 30 27 112 48 moving by the same number of PS units again.
End (alternate) ................ ESC P 0 1B 50 30 27 80 48
If the active font is a PS font, the printer uses the PS unit
values prestored in the font. If the active font is a fixed-
pitch font, the printer uses one-half the normal character
spacing as the number of PS units for every character. All
PS fonts contain prestored PS unit values for characters.
A PS unit value represents one-half the space, in multiples
of 1/120-inch, that is required to print and space a
character. PS unit values range from 2 to 8. For example,
the letter "V" has a PS unit value of 6, so it prints centered
with a space of 12/120-inch (move 6 PS units, print the
"V", and then move 6 PS units). Or, the letter "i" has a PS
unit value of 3, so it prints centered within a space of 6/
120-inch (move 3 PS units, print the "i", and then move 3
PS units).
To determine the total distance from the center line of one
character to the center line of the next character, just add
the two characters' PS unit values. In the example above,
the distance between the center of the "V" and the center
of the "i" is 9/120-inch. All numeric characters (0 to 9)
have the same PS unit value.
After ending proportional mode, character spacing resets
to the default character spacing of the active font. If the
active font is a PS font, character spacing resets to 12
characters per inch.
Note: The ESC P n sequence is not supported when an
Epson emulation is active.