[ Previous | Next | Contents | Glossary | Home | Search ]
The graPHIGS Programming Interface: ISO PHIGS Subroutine Reference

INQUIRE TEXT EXTENT (PHOP,*,*,*)

Purpose

Use Inquire Text Extent to inquire the extent of the specified character string in the local 2D text coordinate system. The graPHIGS API uses the specified text attributes for the specified workstation type to compute the extent. STROKE precision is assumed. The text position is (0,0) in the local 2D text coordinate system.

Possible text path attributes include: RIGHT, LEFT, UP or DOWN. The horizontal alignment for the text may be set to NORMAL, LEFT, CENTER, or RIGHT, and the vertical text alignment may be set to NORMAL, TOP, CAP, HALF, BASE or BOTTOM.

The concatenation offset, with a suitable modeling transformation applied to account for the character up vector, indicates the text position for the concatenation of a subsequent text output primitive in the local 2D text coordinate system. This includes for text paths RIGHT and LEFT, a suitable modification to adjust for the intercharacter spacing of the last character as specified by the character spacing parameter.

If the information is available, then the graPHIGS API sets the error indicator to zero and returns the values in the output parameters. If the information is unavailable, then the values returned in the output parameters are unpredictable and the graPHIGS API sets the error indicator to one of the following errors:

2
Function Requires State (PHOP,*,*,*)
52
Workstation Type Not Recognized By Implementation
51
Information Not Available For Generic Workstation Type
62
This Information Not Available For MO Workstation Type
106
Specified Font Not Available For Requested Text Precision

Language Bindings

C

pinq_text_extent (ws_type, text_font, char_expan, char_space, char_ht, text_path, hor_text_align, vert_text_align, char_string, err_ind, rect, offset)

Input Parameters

Pint ws_type
Workstation type.

Pint text_font
Text font.

Pfloat char_expan
Character expansion factor.

Pfloat char_space
Character spacing.

Pfloat char_ht
Character height.

Ptext_path text_path
Text path (0=PPATH_RIGHT, 1=PPATH_LEFT, 2=PPATH_UP, 3=PPATH_DOWN).

Phor_text_align hor_text_align
Horizontal text alignment (0=PHOR_NORM, 1=PHOR_LEFT, 2=PHOR_CTR, 3=PHOR_RIGHT).

Pvert_text_align vert_text_align
Vertical text alignment (0=PVERT_NORM, 1=PVERT_TOP, 2=PVERT_CAP, 3=PVERT_HALF, 4=PVERT_BASE, 5=PVERT_BOTTOM).

const char *char_string
Character string.

Output Parameters

Pint *err_ind
Error indicator.

Prect *rect
Extent rectangle.

Ppoint *offset
Concatenation offset.

FORTRAN

PQTXX (wktype, font, chxp, chsp, chh, txp, txalh, txalv, str, errind, txexrx, txexry, copx, copy)

Input Parameters

integer wktype
Workstation type.

integer font
Text font.

real chxp
Character expansion factor.

real chsp
Character spacing.

real chh
Character height.

integer txp
Text path (0=PRIGHT, 1=PLEFT, 2=PUP, 3=PDOWN).

integer txalh
Horizontal text alignment (0=PAHNOR, 1=PALEFT, 2=PACENT, 3=PARITE).

integer txalv
Vertical text alignment (0=PAVNOR, 1=PATOP, 2=PACAP, 3=PAHALF, 4=PABASE, 5=PABOTT).

character*(*) str
Character string.

Output Parameters

integer errind
Error indicator.

real txexrx(2)
x coordinates of the text extent rectangle.

real txexry(2)
y coordinates of the text extent rectangle.

real copx
x coordinate of the concatenation offset.

real copy
y coordinate of the concatenation offset.

FORTRAN Subset

PQTXXS (wktype, font, chxp, chsp, chh, txp, txalh, txalv, lstr, str, errind, txexrx, txexry, copx, copy)

Input Parameters

integer wktype
Workstation type.

integer font
Text font.

real chxp
Character expansion factor.

real chsp
Character spacing.

real chh
Character height.

integer txp
Text path (0=PRIGHT, 1=PLEFT, 2=PUP, 3=PDOWN).

integer txalh
Horizontal text alignment (0=PAHNOR, 1=PALEFT, 2=PACENT, 3=PARITE).

integer txalv
Vertical text alignment (0=PAVNOR, 1=PATOP, 2=PACAP, 3=PAHALF, 4=PABASE, 5=PABOTT).

integer lstr
Length of string (in characters).

character*80 str
Character string.

Output Parameters

integer errind
Error indicator.

real txexrx(2)
x coordinates of the text extent rectangle.

real txexry(2)
y coordinates of the text extent rectangle.

real copx
x coordinate of the concatenation offset.

real copy
y coordinate of the concatenation offset.

Errors

None

Related Subroutines

  • None


  • [ Previous | Next | Contents | Glossary | Home | Search ]