summary refs log tree commit diff
path: root/font.c
diff options
context:
space:
mode:
authorokan <okan>2011-06-27 12:46:54 +0000
committerokan <okan>2011-06-27 12:46:54 +0000
commit3db2d84fa8b36f43a72be28fe2c6700e70849552 (patch)
tree8dd4cf362cd62261664ae538f7df3b4bd3824058 /font.c
parentbcf90f5f3494e3406a1b66ed0b6f8232d55e1a16 (diff)
downloadcwm-3db2d84fa8b36f43a72be28fe2c6700e70849552.tar.gz
cwm-3db2d84fa8b36f43a72be28fe2c6700e70849552.tar.xz
cwm-3db2d84fa8b36f43a72be28fe2c6700e70849552.zip
UTF8-ify, from Alexander Polakov, but without setlocale(), after
feedback from stsp@ - thanks!

'go for it' oga@
Diffstat (limited to 'font.c')
-rw-r--r--font.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/font.c b/font.c
index 6ab2b51..cc24eaf 100644
--- a/font.c
+++ b/font.c
@@ -66,7 +66,7 @@ font_width(struct screen_ctx *sc, const char *text, int len)
 {
 	XGlyphInfo	 extents;
 
-	XftTextExtents8(X_Dpy, sc->font, (const XftChar8*)text,
+	XftTextExtentsUtf8(X_Dpy, sc->font, (const FcChar8*)text,
 	    len, &extents);
 
 	return (extents.xOff);
@@ -77,8 +77,7 @@ font_draw(struct screen_ctx *sc, const char *text, int len,
     Drawable d, int x, int y)
 {
 	XftDrawChange(sc->xftdraw, d);
-	/* Really needs to be UTF8'd. */
-	XftDrawString8(sc->xftdraw, &sc->xftcolor, sc->font, x, y,
+	XftDrawStringUtf8(sc->xftdraw, &sc->xftcolor, sc->font, x, y,
 	    (const FcChar8*)text, len);
 }