Center Justification of Printed Text in PCL 5
without concern for character widths.
-
Define a macro containing the text to be right justified. In the following
example, that is id number 1022
-
Position the cursor to the center of the desired text position
-
Set pattern transparency to transparent and pattern to solid white
-
Set print direction to 180 degrees
-
Set the point size to half that of the actual desired size
-
Execute the macro containing the printable text.
-
Set pattern transparency to opaque and pattern to solid black
-
Set print direction to 0 degrees
-
Set the point size to the actual desired size
-
Execute the macro containing the printable text.
<esc>*p4798x540Y<esc>*vo1T<esc>&a180P<esc>(s3V<esc>&f1022Y<esc>&f2X<esc>*v1oT<esc>&a0P<esc>(s6V<esc>&f1022Y<esc>&f2X
Questions:
-
ad@wiegmann-dmp.de asks: "
thies exemple: Center Justification of Printed Text in PCL 5 don't work.
It is also a right justified. how can I do center justified?"
James Newton replies: The only case in which this will not work is if the font is not available in half size or if you use a command to select the half size that is not compatible with the font in use. In the case of the code shown above, the font is assumed to be a proportional spaced font available in 3 and 6 point size as selected by the (s3V or (s6V. For a non-proportional font, use the "h" command instead of the "v" command to select half the CPI or pitch. A more complete example would be
<esc>&f1022yXThis is a test<esc>&f1X<esc>(s1p10v0s0b4148T<esc>*p479x540Y|<esc>*vo1T<esc>&a180P<esc>(s3V<esc>&f1022Y<esc>&f2X<esc>*v1oT<esc>&a0P<esc>(s6V<esc>&f1022Y<esc>&f2X<esc>&l2H
-
See:
Comments: