UTF8-ify, from Alexander Polakov, but without setlocale(), after
feedback from stsp@ - thanks! 'go for it' oga@
This commit is contained in:
5
font.c
5
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user