1XDrawImageString(3) XLIB FUNCTIONS XDrawImageString(3)
2
3
4
6 XDrawImageString, XDrawImageString16 - draw image text
7
9 int XDrawImageString(Display *display, Drawable d, GC gc, int x, int y,
10 _Xconst char *string, int length);
11
12 int XDrawImageString16(Display *display, Drawable d, GC gc, int x, int
13 y, _Xconst XChar2b *string, int length);
14
16 d Specifies the drawable.
17
18 display Specifies the connection to the X server.
19
20 gc Specifies the GC.
21
22 length Specifies the number of characters in the string argument.
23
24 string Specifies the character string.
25
26 x
27 y Specify the x and y coordinates, which are relative to the
28 origin of the specified drawable and define the origin of the
29 first character.
30
32 The XDrawImageString16 function is similar to XDrawImageString except
33 that it uses 2-byte or 16-bit characters. Both functions also use both
34 the foreground and background pixels of the GC in the destination.
35
36 The effect is first to fill a destination rectangle with the background
37 pixel defined in the GC and then to paint the text with the foreground
38 pixel. The upper-left corner of the filled rectangle is at:
39
40 [x, y - font-ascent]
41
42 The width is:
43
44 overall-width
45
46 The height is:
47
48 font-ascent + font-descent
49
50 The overall-width, font-ascent, and font-descent are as would be re‐
51 turned by XQueryTextExtents using gc and string. The function and
52 fill-style defined in the GC are ignored for these functions. The ef‐
53 fective function is GXcopy, and the effective fill-style is FillSolid.
54
55 For fonts defined with 2-byte matrix indexing and used with XDrawIm‐
56 ageString, each byte is used as a byte2 with a byte1 of zero.
57
58 Both functions use these GC components: plane-mask, foreground, back‐
59 ground, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip-
60 mask.
61
62 XDrawImageString and XDrawImageString16 can generate BadDrawable,
63 BadGC, and BadMatch errors.
64
66 BadDrawable
67 A value for a Drawable argument does not name a defined Win‐
68 dow or Pixmap.
69
70 BadGC A value for a GContext argument does not name a defined GCon‐
71 text.
72
73 BadMatch An InputOnly window is used as a Drawable.
74
75 BadMatch Some argument or pair of arguments has the correct type and
76 range but fails to match in some other way required by the
77 request.
78
80 Unlike XDrawString and XDrawString16, these functions send no more than
81 255 characters at a time to the server. When the total number of char‐
82 acters to be sent is larger than 255, these functions split the string
83 into chunks up to 255 characters. After sending each chunk, these
84 functions query the server to determine the actual text extent.
85
87 XDrawString(3), XDrawText(3), XLoadFont(3), XTextExtents(3)
88 Xlib - C Language X Interface
89
90
91
92X Version 11 libX11 1.8.7 XDrawImageString(3)