Hi, I&#39;m getting strange and unreliable results when querying text extents for proportional fonts. (I have no issues with monospace fonts.)<div><br></div><div>The overall_width that&#39;s returned is often a few pixels larger than what it should be. It seems like XCB is assuming all characters in a string are the same pixel width, which will give wrong results if you use a proportional font with &quot;slim&quot; characters like &#39;i&#39;, &#39;1&#39;, &#39;/&#39;, &#39;(&#39;, etc.</div>
<div><br></div><div>However, this could very likely be an issue with how I&#39;m setting up the xcb_char2b_t that I send to xcb_query_text_extents().</div><div><br></div><div><div>xcb_char2b_t *build_chars(char *str, int length)</div>
<div>{</div><div>        xcb_char2b_t *ret = malloc(length * sizeof(xcb_char2b_t));</div><div>        int i;</div><div>        </div><div>        for (i = 0; i &lt; length; i++) {</div><div>                if (str[i] &lt; length) {</div>
<div>                        ret[i].byte1 = str[i];</div><div>                        ret[i].byte2 = &#39;\0&#39;;</div><div>                }</div><div>        }</div><div> </div><div>        return ret;</div><div>}</div>
<div><br></div><div>Parameter &quot;str&quot; is the string I want extents on, obviously, and &quot;length&quot; woud be strlen(str). Is this how I should be going about it?</div></div>