Positioning the First Line of Data
The previous section showed you how to define the size of a logical page. The next two examples show you how to position the first line of data inside the logical page, using the LINEONE subcommand. This subcommand position is relative to the logical page origin, as shown in Figure LINEONE Coordinates. The two coordinates, (1) and (2), of the LINEONE parameter define the starting point for the first line of text.
LINEONE Coordinates
This starting point works with the POSITION, MARGIN, and TOP subcommands (of the PRINTLINE command) to position lines of print on a page.
The defaults for LINEONE are:
x = 0, y = 80% of one line space from the top of the logical page: 80% of 1/6 inch if lines per inch (lpi) = 6, 80% of 1/8 inch if lpi = 8, and so on.
These defaults leave room for the character ascenders in the first line of text.
The following examples illustrate two methods for positioning the first line of text:
- The position of the first line of data defaults by specifying the SETUNITS command prior to the PAGEDEF command, like this:
SETUNITS 1 IN 1 IN LINESP 8 LPI; FORMDEF ABCD OFFSET 0 .5; PAGEDEF ABCD WIDTH 7.5 HEIGHT 10 DIRECTION ACROSS; FONT GS12 GS12; PRINTLINE REPEAT 60 FONT GS12 POSITION 0 TOP;
Note: It is important that the LINESP subcommand (of the SETUNITS command) must precede the PAGEDEF commands.If the LINESP subcommand follows the PAGEDEF command, PPFA then uses the default LINESP value to calculate the y offset value, which is used to position the first line of print.
The default for the LINESP subcommand of the SETUNITS command is 6 lpi. If LINEONE is allowed to default, based upon the LINESP default, the LINEONE value is 31 L-units:
LINEONE = ( ( 240 L-units / 6 lpi ) x 80% ) - 1 L-unit= 31 L-units.
This value is the vertical (y) position of the printline because TOP is specified in a later POSITION subcommand. However, this value may cause the data to exceed the bottom boundary of the logical page if the LINESP value is changed later.
- Another way you can specify the starting position for the first print line is to specify
LINEONE explicitly, like this:
FORMDEF ABCD OFFSET 0 .5; PAGEDEF ABCD WIDTH 7.5 HEIGHT 10 LINEONE 0 PELS 23 PELS DIRECTION ACROSS; SETUNITS 1 IN 1 IN LINESP 8 LPI; FONT GS12 GS12; PRINTLINE REPEAT 60 FONT GS12 POSITION 0 TOP;
In this example, the LINESP subcommand following the PAGEDEF command will not cause a data placement problem because the LINEONE command determines explicitly where the first line of text is positioned, and no default LINESP value is used:
LINEONE = [ ( 240 L-units / 8 lpi ) x 80% ] - 1 L-unit= 23 L-units
If you use the LINEONE command to specify an absolute starting position for the first line, in L-units, you must remember to subtract one L-unit from that value.