Plotting Text

The 'TEXT' mnemonic is used to place text on the plotting surface. The 'TEXT' mnemonic uses the following syntax:

'TEXT'(x,y,textstring{,mode{,rotation{,scale{,scale}}}})

Parameter

Description

x,y

Starting point for the text

textstring

string expression describing the text to be plotted

mode

Integer describing the method of printing

rotation

Text rotation fromx,yin radians

scale(width)

The multiplier for character width

scale(height)

if given, height scale

Text may be placed starting on any point. Rotation is defined such that the text is printed on a line moving from the starting point at an angle defined by rotation, where a rotation of PI (180 degrees) would cause the text to be printed from right to left upside down.

The mode is a bit mapped integer and is used in the following manner:

Bit

Value

Description

0-1

0

Align columns left (text starts on X)

 

1

Align columns center (text is centered on X)

 

2

Align columns right (text ends on X)

2-3

0

Align bottom row (text is above Y)

 

4

Align center row (text is centered on Y)

 

8

Align top row (text is below Y)

7

128

Place text proportionally (characters may Differ in width)

The current character size relative to the world is returned in the FIN() data.

Moving Objects Around

A standard object may be defined and then plotted in different locations using the 'OFFSET' mnemonic. The 'OFFSET' mnemonic accepts 2 arguments, the X and Y offsets. These values are always added to all of the points being plotted. Setting the offset to 0,0 effectively disables the offset usage.

Object and Plot Rotation

The plotting data may be geometrically rotated by specifying a rotation angle using the 'ROTATE' mnemonic. 'ROTATE' accepts an argument in radians. The rotation angle will be applied to all points used in plotting. Rotation is always performed relative to the 0,0 position on the display.

Painting On Raster Devices

The 'PAINT' mnemonic may be used to fill a region of the screen if the plotting device is known to be a raster device. The syntax for the 'PAINT' mnemonic is:

'PAINT'(x,y,color)

Argument

Description

x,y

Starting point for painting

color

New color for region

The plot driver will retrieve the color of the pixel at the position described by the starting point x,y and, if the color is different than color, make that pixel and all pixels connected to the starting pixel (rectangularly) that are the same starting color the new color.

NOTE: It is possible to attempt to draw a screen that will require more memory to paint than most shapes that will be encountered in normal operation. In this case, the plot driver will ring the bell and return control to PRO/5 without completing the paint command.