ptext(3g) — Subroutines
Name
ptext − Writes and positions a character string (2D form).
Operating States: PHOP, ∗, STOP, ∗
PHIGS standard function
Creates a structure element
Syntax
void ptext (
const Ppoint ∗text_pos, /∗ (I) Text position, in modeling
coordinates ∗/
const char ∗text /∗ (I) Character string ∗/
)
Data Structures
typedef struct {
Pfloat x; /∗ x coordinate ∗/
Pfloat y; /∗ y coordinate ∗/
} Ppoint;
Description
ptext writes a character string and positions it for display according to the text point specified in modeling coordinate units. Associated text attributes, normalization transformation, and the capabilities of the workstation also affect the appearance of the string.
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 text element.
The ptext function specifies the two-dimensional (x and y) form of the text primitive. Its z-coordinate is set to 0. A call to this function has the following effects during structure traversal:
•Digital PHIGS generates a character string in the text position on a text plane.
The text plane and the local coordinate system, in which all geometric text attributes are measured on that plane, are defined by a point and two vectors contained in the definition of the primitive. This point is the text position. The two vectors are the first direction vector and the second direction vector. To illustrate the use of the local coordinate system, assume the following:
•P is the text position.
•U and V are the first and second text direction vectors.
•T is a vector perpendicular to U and in the text plane.
The text plane is the plane that contains P and is perpendicular to UxV. The origin of the local coordinate system is at the point P. The positive x-axis of the local coordinate system is parallel to U. If the dot product of TxV is positive, the positive y-axis is parallel to T. Otherwise, the positive y-axis is opposite T.
•Digital PHIGS binds the current values of the text attributes, as defined in the PHIGS traversal state list, to the text primitive.
The text precision attribute affects text clipping.
If Digital PHIGS is in immediate mode, it performs this function immediately, but the function does not create a structure element.
See Also
padd_names_set
pinq_text_extent
pinq_text_facs
premove_names_set
pset_char_expan
pset_char_ht
pset_char_space
pset_char_up_vec
pset_depth_cue_ind
pset_hlhsr_id
pset_indiv_asf
pset_pick_id
pset_text_align
pset_text_colr
pset_text_colr_ind
pset_text_font
pset_text_ind
pset_text_path
pset_text_prec
pset_view_ind
ptext3