From 4508fd2c4ee3171bdc1bffb7e53ecda8290292ef Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Thu, 24 Jun 2010 17:44:35 +0100 Subject: moved draw.c to libdraw.a --- draw/textnw.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 draw/textnw.c (limited to 'draw/textnw.c') diff --git a/draw/textnw.c b/draw/textnw.c new file mode 100644 index 0000000..9c0c122 --- /dev/null +++ b/draw/textnw.c @@ -0,0 +1,14 @@ +/* See LICENSE file for copyright and license details. */ +#include +#include "draw.h" + +int +textnw(DC *dc, const char *text, unsigned int len) { + XRectangle r; + + if(dc->font.set) { + XmbTextExtents(dc->font.set, text, len, NULL, &r); + return r.width; + } + return XTextWidth(dc->font.xfont, text, len); +} -- cgit v1.2.3-13-gbd6f