1xcb_query_text_extents(3) XCB Requests xcb_query_text_extents(3)
2
3
4
6 xcb_query_text_extents - get text extents
7
9 #include <xcb/xproto.h>
10
11 Request function
12 xcb_query_text_extents_cookie_t
13 xcb_query_text_extents(xcb_connection_t *conn,
14 xcb_fontable_t font, uint32_t string_len, const
15 xcb_char2b_t *string);
16
17 Reply datastructure
18 typedef struct xcb_query_text_extents_reply_t {
19 uint8_t response_type;
20 uint8_t draw_direction;
21 uint16_t sequence;
22 uint32_t length;
23 int16_t font_ascent;
24 int16_t font_descent;
25 int16_t overall_ascent;
26 int16_t overall_descent;
27 int32_t overall_width;
28 int32_t overall_left;
29 int32_t overall_right;
30 } xcb_query_text_extents_reply_t;
31
32 Reply function
33 xcb_query_text_extents_reply_t
34 *xcb_query_text_extents_reply(xcb_connection_t *conn,
35 xcb_query_text_extents_cookie_t cookie,
36 xcb_generic_error_t **e);
37
39 conn The XCB connection to X11.
40
41 font The font to calculate text extents in. You can also pass a
42 graphics context.
43
44 string_len
45 The number of characters in string.
46
47 string The text to get text extents for.
48
50 response_type
51 The type of this reply, in this case XCB_QUERY_TEXT_EXTENTS.
52 This field is also present in the xcb_generic_reply_t and can
53 be used to tell replies apart from each other.
54
55 sequence The sequence number of the last request processed by the X11
56 server.
57
58 length The length of the reply, in words (a word is 4 bytes).
59
60 draw_direction
61 One of the following values:
62
63 XCB_FONT_DRAW_LEFT_TO_RIGHT
64 TODO: NOT YET DOCUMENTED.
65
66 XCB_FONT_DRAW_RIGHT_TO_LEFT
67 TODO: NOT YET DOCUMENTED.
68 TODO: NOT YET DOCUMENTED.
69
70 font_ascent
71 TODO: NOT YET DOCUMENTED.
72
73 font_descent
74 TODO: NOT YET DOCUMENTED.
75
76 overall_ascent
77 TODO: NOT YET DOCUMENTED.
78
79 overall_descent
80 TODO: NOT YET DOCUMENTED.
81
82 overall_width
83 TODO: NOT YET DOCUMENTED.
84
85 overall_left
86 TODO: NOT YET DOCUMENTED.
87
88 overall_right
89 TODO: NOT YET DOCUMENTED.
90
92 Query text extents from the X11 server. This request returns the bound‐
93 ing box of the specified 16-bit character string in the specified font
94 or the font contained in the specified graphics context.
95
96 font_ascent is set to the maximum of the ascent metrics of all charac‐
97 ters in the string. font_descent is set to the maximum of the descent
98 metrics. overall_width is set to the sum of the character-width met‐
99 rics of all characters in the string. For each character in the string,
100 let W be the sum of the character-width metrics of all characters pre‐
101 ceding it in the string. Let L be the left-side-bearing metric of the
102 character plus W. Let R be the right-side-bearing metric of the charac‐
103 ter plus W. The lbearing member is set to the minimum L of all charac‐
104 ters in the string. The rbearing member is set to the maximum R.
105
106 For fonts defined with linear indexing rather than 2-byte matrix index‐
107 ing, each xcb_char2b_t structure is interpreted as a 16-bit number with
108 byte1 as the most significant byte. If the font has no defined default
109 character, undefined characters in the string are taken to have all ze‐
110 ro metrics.
111
112 Characters with all zero metrics are ignored. If the font has no de‐
113 fined default_char, the undefined characters in the string are also ig‐
114 nored.
115
117 Returns an xcb_query_text_extents_cookie_t. Errors have to be handled
118 when calling the reply function xcb_query_text_extents_reply.
119
120 If you want to handle errors in the event loop instead, use
121 xcb_query_text_extents_unchecked. See xcb-requests(3) for details.
122
124 xcb_font_error_t
125 The specified font does not exist.
126
127 xcb_g_context_error_t
128 The specified graphics context does not exist.
129
131 xcb-requests(3)
132
134 Generated from xproto.xml. Contact xcb@lists.freedesktop.org for cor‐
135 rections and improvements.
136
137
138
139X Version 11 libxcb 1.12 xcb_query_text_extents(3)