diff options
author | okan | 2011-06-27 12:46:54 +0000 |
---|---|---|
committer | okan | 2011-06-27 12:46:54 +0000 |
commit | 5da15f4cdec08345db8271d94648ce7cb1166c8d (patch) | |
tree | c5f05049eacb2bcf7fa7ec313db37dd5ffa86c57 /font.c | |
parent | 5d5f633410d9d7955ef1191e698425a45bcf6ec3 (diff) | |
download | cwm-5da15f4cdec08345db8271d94648ce7cb1166c8d.tar.gz |
UTF8-ify, from Alexander Polakov, but without setlocale(), after
feedback from stsp@ - thanks!
'go for it' oga@
Diffstat (limited to '')
-rw-r--r-- | font.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: font.c,v 1.15 2011/06/24 05:45:57 okan Exp $ + * $OpenBSD: font.c,v 1.16 2011/06/27 12:46:54 okan Exp $ */ #include <sys/param.h> @@ -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); } |