diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-13 10:33:16 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-13 10:33:16 +0000 |
| commit | 7f2ee77204b1e8aca39262f9a3ba9235539371de (patch) | |
| tree | 82396248d36906211f5596ce60a9d6d9ba1d778f | |
| parent | ffb237bf4033df1bcf4a863cbe20970c1a66dcd9 (diff) | |
use the byte size for utf strings, not the character size
| -rw-r--r-- | otk/font.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/otk/font.cc b/otk/font.cc index a9f2fd3e..a51e158c 100644 --- a/otk/font.cc +++ b/otk/font.cc @@ -97,11 +97,11 @@ void Font::drawString(XftDraw *d, int x, int y, const Color &color, if (string.utf8()) XftDrawStringUtf8(d, &c, _xftfont, x + _offset, _xftfont->ascent + y + _offset, - (FcChar8*)string.c_str(), string.size()); + (FcChar8*)string.c_str(), string.bytes()); else XftDrawString8(d, &c, _xftfont, x + _offset, _xftfont->ascent + y + _offset, - (FcChar8*)string.c_str(), string.size()); + (FcChar8*)string.c_str(), string.bytes()); } XftColor c; @@ -113,10 +113,10 @@ void Font::drawString(XftDraw *d, int x, int y, const Color &color, if (string.utf8()) XftDrawStringUtf8(d, &c, _xftfont, x, _xftfont->ascent + y, - (FcChar8*)string.c_str(), string.size()); + (FcChar8*)string.c_str(), string.bytes()); else XftDrawString8(d, &c, _xftfont, x, _xftfont->ascent + y, - (FcChar8*)string.c_str(), string.size()); + (FcChar8*)string.c_str(), string.bytes()); return; } @@ -128,10 +128,10 @@ unsigned int Font::measureString(const ustring &string) const if (string.utf8()) XftTextExtentsUtf8(**display, _xftfont, - (FcChar8*)string.c_str(), string.size(), &info); + (FcChar8*)string.c_str(), string.bytes(), &info); else XftTextExtents8(**display, _xftfont, - (FcChar8*)string.c_str(), string.size(), &info); + (FcChar8*)string.c_str(), string.bytes(), &info); return info.xOff + (_shadow ? _offset : 0); } |
