patch for Benderunit to check UTF8 issues

This commit is contained in:
Anselm R. Garbe 2006-04-27 13:40:26 +02:00
parent adcab2b78a
commit 94a12749cb
3 changed files with 5 additions and 5 deletions

View File

@ -32,7 +32,7 @@ update_client_name(Client *c)
if(name.encoding == XA_STRING)
cext_strlcpy(c->name, (char *)name.value, sizeof(c->name));
else {
if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success
if(Xutf8TextPropertyToTextList(dpy, &name, &list, &n) >= Success
&& n > 0 && *list)
{
cext_strlcpy(c->name, *list, sizeof(c->name));

View File

@ -102,8 +102,8 @@ xdrawtext(Display *dpy, BlitzDraw *d)
}
XSetBackground(dpy, d->gc, d->color.bg);
XSetForeground(dpy, d->gc, d->color.fg);
if(d->font.set)
XmbDrawString(dpy, d->drawable, d->font.set, d->gc, x, y, text, len);
if(0&&d->font.set)
Xutf8DrawString(dpy, d->drawable, d->font.set, d->gc, x, y, text, len);
else
XDrawString(dpy, d->drawable, d->gc, x, y, text, len);
}

View File

@ -14,8 +14,8 @@ unsigned int
blitz_textwidth(Display *dpy, BlitzFont *font, char *text)
{
XRectangle r;
if(font->set) {
XmbTextExtents(font->set, text, strlen(text), nil, &r);
if(0&&font->set) {
Xutf8TextExtents(font->set, text, strlen(text), nil, &r);
return r.width;
}
return XTextWidth(font->xfont, text, strlen(text));