Yao Zhang <[EMAIL PROTECTED]> writes:
> It seems like there is a problem with Xft2 extents calculation. The
> test code is attached.
>
> The command I use to compile is
> gcc -o test0 test0.c -Wall `pkg-config --cflags xft` `pkg-config --libs xft`
>
> I am testing it on a brand new RH Limbo. The result (in UTF-8) is also
> attached. For a string in Chinese, its extents are all 0.
>
> I tried fcpackage.02-06-27.17-59.tar.gz and the result is the same.
Problem is that XftTextExtentsUtf8 is missing a character => glyph
conversion.
I think the attached (untested) patch should fix.
Regards,
Owen
--- fcpackage.02-06-26.15-17/Xft/xftextent.c.extents Fri Jul 5 21:24:41 2002
+++ fcpackage.02-06-26.15-17/Xft/xftextent.c Fri Jul 5 21:25:01 2002
@@ -237,7 +237,7 @@
free (glyphs);
glyphs = glyphs_new;
}
- glyphs[i++] = ucs4;
+ glyphs[i++] = XftCharIndex (dpy, public, ucs4);
string += l;
len -= l;
}