next up previous contents
Next: Printing Characters on the Up: Rectangleslines, dots, arcs Previous: Drawing Text in a

Finding the Width of Characters

This can be done for 8 and 16 bit characters.

int XTextWidth(font_struct,str, count)
    char *str;           /* string */
    XFontStruct *font_struct;  /* font-id of font to use */

int XTextWidth16(font_struct,str, count)
    char *str;           /* string */
    XFontStruct *font_struct;  /* font-id of font to use */

XTextExtents(font_struct,string,nchars,direction,ascent,descent,overall)
    XFontStruct *font_struct;
    char *str;           /* string            */
    int *direction, *ascent, *descent; /*returned dimensions */
    XCharStruct     *overall; /* overall retured dimensions */

XTextExtents16(font_struct,string,nchars,direction,ascent,descent,overall)


Tim Love
Mon Mar 11 17:03:18 GMT 1996