moved draw.c to libdraw.a
[dmenu.git] / draw / 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 }