18.7. Text.   


TEXT (X,Y,String)
Parameters: X,Y real coordinates in World Co-ordinate System.
String: Character sting
Text(6,4.5,'Hello World');
or Text(-35.67,106, stringarray)

String is output at X,Y position.

18.7.1. Text Attributes.   

There are other attributes associated with text:


Character height real in w.c. (height/width ratio is set by font)
Character up vector X,Y direction in w.c.
Text path UP, DOWN, LEFT, RIGHT.
Text alignment: Horizontal, left, centre, right.
Vertical, TOP, CAP, BASE, HALF, BOTTOM.

Also set text index(N) and set text representation (WS,TI,TFP,CEF,CS,TCI)
WS = workstation TI = Text Index
TFP = Text Font and Precision (Normally 2 parameters) font part =>which font as defined by system precision part =>STRING: lowest type of character generation
CHAR: individual characters affected by attributes
STROKE: font displayed exactly using all attributes
CEF = Character expansion factor : changes aspect ratio of char.
CS = Character spacing : font is assumed to cater for space between characters. This allows for an increase or decrease in the normally zero space.
TCI = Text colour index : as for polyline.

Text primitive is most complex of all and requires many attributes.
Note that not all devices are capable of high quality (STROKE) output
and therefore will default to a lower quality.
i.e. T4010 cannot angle text => need software character generator.

18.7.2. Character Up Vector.   

Determines orientation for characters in terms of X,Y and also sets reference direction for text path and alignment. NOTE vector is really just specifying an angle:

i.e. set character up vector (1,1) both give 45 degrees set character up vector (15,15)


 
Character Up Vector example
Fig. 18.5 : Character Up Vector example

18.7.3. Text Path.   



 
Text Path example
Fig. 18.6 : Text Path example
Default is right. Note that left does NOT reverse characters. Characters follow direction of Character Up Vector.

18.7.4. Text Alignment.   

Set text alignment (HORIZ,VERT)

Horizontal alignment: Left, centre, right - like justification. Vertical alignment: Top, Bottom, Cap, Base, Half. These are alignment boundaries within the character font.

NOTE: horiz and vert are set by character up vector.

BASE is usually very important since it is line on which letters sit.

Text defaults: When the text path is set to right, the normal or default alignment should be left and when the text path is left, the alignment should be right. This implies that a normal alignment exists: GKS recognises this and allows another value of NORMAL.

Set text alignment (NORMAL,TOP) Set text alignment (NORMAL, NORMAL)

Real text: It is silly to assume that a device such as the T4010 can produce characters at any UP vector and at different aspect ratios. The text representation indicates what should happen if it can.

STROKE uses all attributes of TEXT CHAR uses fewer attributes STRING may use no attributes

Transforming of window to viewport may not shrink the text small enough (or at all) and hence a decision has to be made for char or string type devices as to whether the text should appear at all within the viewport.

Clipping of text now also depends upon the type of text. (Again T4010 cannot be expected to clip halfway through the character).