PEXQueryTextExtents(3) — Subroutines
Name
PEXQueryTextExtents - Query Text Extents
Synopsis
PEXTextExtent ∗PEXQueryTextExtents(Display ∗display, XID resource_id, unsigned int font_table_index, int path, double expansion, double spacing, double height, int halign, int valign, unsigned long count, PEXStringData ∗text)
Arguments
displayA pointer to a display structure returned by a successful XOpenDisplay call.
resource_idThe resource identifier of either a renderer, a workstation or a text font table.
font_table_index
The text font table index.
pathThe text path (PEXPathRight, PEXPathLeft, PEXPathUp, PEXPathDown).
expansionThe text character expansion factor.
spacingThe text character spacing factor.
heightThe text character height.
halignThe text horizontal text alignment (PEXHAlignNormal, PEXHAlignLeft, PEXHAlignCenter, PEXHAlignRight).
valignThe text vertical text alignment (PEXVAlignNormal, PEXVAlignTop, PEXVAlignCap, PEXVAlignHalf, PEXVAlignBase, PEXVAlignBottom).
countThe number of text strings.
textAn array of text strings.
Returns
An array of text extents; a null pointer if unsuccessful.
Description
This function returns the text extents, in the local 2D text coordinate system, of each specified text string. If the resource identifier is a renderer or PHIGS workstation, then the text font table associated with the renderer or workstation is used. If the resource identifier is a text font lookup table, it is used directly. The specified font group provides the index of the entry that is to be used to obtain the font group. The first character set in the font will be used.
Stroke precision is assumed. The text position is (0,0) in the local 2D text coordinate system. The extent of each string is computed independent of the other strings.
If a specified font has no defined default glyph, then undefined glyphs are taken to have all zero metrics.
The extent data is returned in memory allocated by PEXlib. XFree should be called to deallocate the memory.
Data Structures
typedef struct {
unsigned short length;
char ∗ch;
} PEXStringData;
typedef struct {
PEXCoord2D lower_left;
PEXCoord2D upper_right;
PEXCoord2D concat_point;
} PEXTextExtent;
typedef struct {
float x;
float y;
} PEXCoord2D;
Errors
BadMatchThe specified resource identifier identifies a table of type other than a text font table.
BadValueA specified value for one or text attributes is invalid, or the specified resource identifier does not identify a valid renderer, workstation or lookup table resource.
See Also
PEXQueryEncodedTextExtents