aboutsummaryrefslogtreecommitdiffstats
path: root/tabbed-0.6-xft.diff
blob: a6ed8816df9cca38ff360b02a87cc5cd481db6e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@@ -1040,15 +1000,9 @@ spawn(const Arg *arg) {
 
 int
 textnw(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);
+	XGlyphInfo ext;
+	XftTextExtentsUtf8(dpy, dc.font.xfont, (XftChar8 *) text, len, &ext);
+	return ext.xOff;
 }
 
 void