pset_text_align(3g) — Subroutines
Name
pset_text_align − Controls the position of the text extent parallelogram in relation to the text position.
Operating States: PHOP, ∗, STOP, ∗
PHIGS standard function
Creates a structure element
Syntax
void pset_text_align (
const Ptext_align ∗text_align /∗ (I) Text alignment ∗/
)
Data Structures
typedef struct {
Phor_text_align hor; /∗ horizontal component ∗/
Pvert_text_align vert; /∗ vertical component ∗/
} Ptext_align;
typedef enum {
PHOR_NORM, /∗ Normal horizontal alignment. This is the default
value. ∗/
PHOR_LEFT, /∗ Left horizontal alignment. ∗/
PHOR_CTR, /∗ Center horizontal alignment. ∗/
PHOR_RIGHT /∗ Right horizontal alignment. ∗/
} Phor_text_align;
typedef enum {
PVERT_NORM, /∗ Normal vertical alignment. This is the default
value. ∗/
PVERT_TOP, /∗ Top vertical alignment. ∗/
PVERT_CAP, /∗ Cap vertical alignment. ∗/
PVERT_HALF, /∗ Half vertical alignment. ∗/
PVERT_BASE, /∗ Base vertical alignment. ∗/
PVERT_BOTTOM /∗ Bottom vertical alignment. ∗/
} Pvert_text_align;
Description
pset_text_align uses the text alignment horizontal and text alignment vertical values to control the position of the text extent parallelogram in relation to the text position. Depending on the current edit mode, this function either inserts the new structure element directly after the element indicated by the pointer or replaces the element indicated by the pointer. The pointer then points to the new set text alignment element.
The set text alignment element sets the specified values for the current text alignment entry in the PHIGS traversal state list. Digital PHIGS uses the value when traversing subsequent text and text 3 primitives.
Digital PHIGS defines a text string within a text extent rectangle. This rectangle is an imaginary parallelogram that completely contains the text string to be displayed. It is established when you create a text primitive with the ptext output function.
The text alignment attribute controls the positioning of this text extent parallelogram in relation to the text position. The text alignment is described in terms of the default character up vector and character base vector. The horizontal component of text alignment has four possible values:
•LEFT---The left side of the text extent parallelogram passes through the text position.
•RIGHT---The right side of the text extent parallelogram passes through the text position.
•CENTRE---The text position lies midway between the left and right sides of the text extent parallelogram. If the text path is UP or DOWN, the straight line passing through the centerlines of the characters also passes through the text position.
•NORMAL---At traversal, the meaning of NORMAL will be the same as one of the other values, according to the current value of the text path attribute.
Each of the possible values for the vertical component of the text alignment corresponds to one of the font-specific lines in the definition of a character (see the DEC PHIGS Developer’s Guide for more information on characters). The vertical component of the text alignment has six possible values:
•NORMAL---The default positioning, which depends on the text path used.
•TOP---The top of the text extent parallelogram passes through the text position.
•CAP---If the text path is either LEFT or RIGHT, the text position lies on the capline of the whole string. If the text path is either UP or DOWN, the text position lies on the capline of the topmost character in the string.
•HALF---If the text path is either LEFT or RIGHT, the text position lies on the half line of the whole string. If the text path is either UP or DOWN, the text position lies on a line halfway between the half lines of the top and bottom characters.
•BASE---If the text path is either LEFT or RIGHT, the text position lies on the baseline of the whole string. If the text path is UP or DOWN, the text position lies on the baseline of the bottom character in the string.
•BOTTOM---The bottom of the text extent parallelogram passes through the text position.
During structure traversal, Digital PHIGS sets the current text alignment entry in the PHIGS traversal state list to the value defined by the specified values.
If Digital PHIGS is in immediate mode, it performs this function immediately, but the function does not create a structure element.
See Also
pinq_text_extent
pinq_text_facs
pset_anno_align
pset_text_path
ptext
ptext3