XTextExtents(3X) — X Version 11
NAME
XTextExtents, XTextExtents16, XQueryTextExtents, XQueryTextExtents16 − compute or query text extents
SYNTAX
XTextExtents(font_struct, string, nchars, direction_return, font_ascent_return,
font_descent_return, overall_return)
XFontStruct ∗font_struct;
char ∗string;
int nchars;
int ∗direction_return;
int ∗font_ascent_return, ∗font_descent_return;
XCharStruct ∗overall_return;
XTextExtents16(font_struct, string, nchars, direction_return, font_ascent_return,
font_descent_return, overall_return)
XFontStruct ∗font_struct;
XChar2b ∗string;
int nchars;
int ∗direction_return;
int ∗font_ascent_return, ∗font_descent_return;
XCharStruct ∗overall_return;
XQueryTextExtents(display, font_ID, string, nchars, direction_return, font_ascent_return,
font_descent_return, overall_return)
Display ∗display;
XID font_ID;
char ∗string;
int nchars;
int ∗direction_return;
int ∗font_ascent_return, ∗font_descent_return;
XCharStruct ∗overall_return;
XQueryTextExtents16(display, font_ID, string, nchars, direction_return, font_ascent_return,
font_descent_return, overall_return)
Display ∗display;
XID font_ID;
XChar2b ∗string;
int nchars;
int ∗direction_return;
int ∗font_ascent_return, ∗font_descent_return;
XCharStruct ∗overall_return;
ARGUMENTS
font_ascent_return
Returns the font ascent member.
font_descent_return
Returns the font descent member.
direction_return
Returns the value of the direction hint member: FontLeftToRight or FontRightToLeft.
displaySpecifies the connection to the X server.
font_IDSpecifies either the font ID or the graphics context that contains the font.
font_structSpecifies a pointer to the XFontStruct structure.
ncharsSpecifies the number of characters in the character string.
stringSpecifies the character string.
overall_return
Returns the overall size in the specified XCharStruct structure.
DESCRIPTION
The XTextExtents and XTextExtents16 functions return the logical extents of the specified 1-byte and 2-byte character string.
The XQueryTextExtents and XQueryTextExtents16 functions return the bounding box of the specified 8-bit and 16-bit character string in the specified font or the font contained in the specified GC. .PN XQueryTextExtents and .PN XQueryTextExtents16 can generate BadFont and BadGC errors.
DIAGNOSTICS
BadFont A value for a Font or GContext argument does not name a defined Font.
BadGC A value for a GContext argument does not name a defined GContext.
SEE ALSO
XTextWidth(3X)
Xlib − C Language X Interface
1 March 1988