next up previous contents
Next: Creating Cursors Up: Rectangleslines, dots, arcs Previous: Finding the Width of

Printing Characters on the Screen

For strings of a single font use

XDrawString(display,d,gc,x, y,string,length)
XDrawImageString(display,d,gc,x, y,string,length) /*draws background too*/
XDrawImageString16(display,d,gc,x, y,string,length) /*draws background too*/
Otherwise the text to be output needs to be held in the following structure:-
typedef struct {
    char *chars;    /* pointer to string */
    int nchars;     /* number of characters */
    int delta;      /* delta between strings */
    Font font;      /* font to print it in, None don't change */
} XTextItem;

XDrawText(display,d,gc,x, y,items,nitems)
    XTextItem *items;
XDrawText16(display,d,gc,x, y,items,nitems)
    XTextItem *items;

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