User manual
61
TEXT CENTERING SUPPLEMENT
(New feature for 26/46 only)
FGL Text Centering Command - <CTR####>
The FGL centering command is based on the concept of a text field. The text field has a starting position and
length as well as other FGL attributes that define the text formatting. The field length is provided as a parameter
to the centering command (<CTR1000>) and specifies the field length in dots. The remaining attributes are
provided by the current state of the FGL command interpreter including, starting position, font selection and
scale factors (height, width and scale down). The text string should immediately follow the centering command
and is identified by a start and stop delimiter the tilde character ( “~”, ASCII value 0x7E ). The text string should
only include printable characters; control characters and FGL commands are not permitted.
If the length of the text string exceeds the length of the text field the text string will be left justified and the string
will be allowed to extend beyond the end of the field. In addition, if the length of the text field added to the
starting position exceeds the length or width of the ticket the field length will be truncated to fit within the ticket
boundaries. This can be used to your advantage when centering text in the middle of a ticket by moving the
cursor to the edge of the ticket and defining a field obviously longer (or wider) than the ticket (<CTR4000>).
Since the field length is clipped to the ticket length the text field covers the entire length of the ticket and the text
string is centered on the ticket. The centering command works for resident fonts, downloaded soft fonts and
TrueType outline fonts.
Example: “<NR><RC100,100><F13><HW2,2><CTR1000>~Centered Text~<p>”
The example code places the starting position of the text field at 100 dots from the left edge and 100 dots down
from the top edge of the ticket (FGL non-rotated orientation). The text string will use Font 13 with the height and
width scaled by a factor of 2. The text field is define as 1000 dots long and will have the text string “Centered
Text” centered within the field.