-int BC_WindowBase::wcharpos(const wchar_t *text, XftFont *font, int length,
- int *charpos)
-{
- XGlyphInfo extents;
-
- if(charpos)
- {
- int bpos = charpos[-1];
-
- for(int i = 0; i < length; i++)
- {
- XftTextExtents32(top_level->display,
- font,
- (const FcChar32*)text,
- i + 1,
- &extents);
- charpos[i] = extents.xOff + bpos;
- }
- return charpos[length - 1] - bpos;
- }
- else
- {
- XftTextExtents32(top_level->display,
- font,
- (const FcChar32*)text,
- length,
- &extents);
- return extents.xOff;
- }
-}
-