PEXQueryTextExtents - Query Text Extents (5.0)


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

display
A pointer to a display structure returned by a successful XOpenDisplay call.

resource_id
The resource identifier of either a renderer, a workstation or a text font table.

font_table_index
The text font table index.

path
The text path (PEXPathRight, PEXPathLeft, PEXPathUp or PEXPathDown).

expansion
The text character expansion factor.

spacing
The text character spacing factor.

height
The text character height.

halign
The text horizontal text alignment (PEXHAlignNormal, PEXHAlignLeft, PEXHAlignCenter or PEXHAlignRight).

valign
The text vertical text alignment (PEXVAlignNormal, PEXVAlignTop, PEXVAlignCap, PEXVAlignHalf, PEXVAlignBase or PEXVAlignBottom).

count
The number of text strings.

text
An array of text strings.

Returns

An array of text extents; a null pointer if unsuccessful.

Description

Invoke PEXQueryTextExtents to get the geometric extent and the concatenation point for each specified text string. The extent of a string is the smallest rectangle completely surrounding it.

The concatenation point is the position to place another string if the string is to be extended. The client may still need to apply a suitable modeling transformation to account for the character up vector.

If the resource identifier is a renderer or PHIGS workstation, then this function uses the text font table associated with the renderer or workstation. If the resource identifier is a text font lookup table, then this function uses it directly. The specified font_table_index provides the index of the entry that this function uses to get the font group. The first character set in the font group is used for all strings in text. If that font group does not define a font for character set 1, then the implementation substitutes the font for character set 1 of the default font group.

Stroke precision is assumed.

The extent and concatenation point of each string is computed independently of the other strings in the list.

If the selected font has no defined default glyph, then this function assumes undefined glyphs have all zero metrics.

The extent data is returned in memory allocated by PEXlib. Invoke XFree to deallocate the memory.

Errors

BadMatch
The specified resource identifier identifies a table of a type other than a text font table.

BadValue
A specified value for one or more text attributes is invalid, or the specified resource identifier does not identify a valid renderer, workstation or lookup table resource.

See Also

For a list of PEX Font functions and related topics, see PEX Fonts.