UTF8-ify, from Alexander Polakov, but without setlocale(), after

feedback from stsp@ - thanks!

'go for it' oga@
This commit is contained in:
okan
2011-06-27 12:46:54 +00:00
parent bcf90f5f34
commit 3db2d84fa8
2 changed files with 7 additions and 8 deletions

5
font.c
View File

@@ -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);
}