pinosaur
/
dmenu.git
/ blob
9c0c12282b989a23031cf0b47fe854a553f545af
[dmenu.git]
/
textnw.c
1
/* See LICENSE file for copyright and license details. */
2
#include <X11/Xlib.h>
3
#include "draw.h"
4
5
int
6
textnw(DC *dc, const char *text, unsigned int len) {
7
XRectangle r;
8
9
if(dc->font.set) {
10
XmbTextExtents(dc->font.set, text, len, NULL, &r);
11
return r.width;
12
}
13
return XTextWidth(dc->font.xfont, text, len);
14
}