all repos — openbox @ 7f2ee77204b1e8aca39262f9a3ba9235539371de

openbox fork - make it a bit more like ryudo

use the byte size for utf strings, not the character size
Dana Jansens danakj@orodu.net
commit

7f2ee77204b1e8aca39262f9a3ba9235539371de

parent

ffb237bf4033df1bcf4a863cbe20970c1a66dcd9

1 files changed, 6 insertions(+), 6 deletions(-)

jump to
M otk/font.ccotk/font.cc

@@ -97,11 +97,11 @@

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 @@ c.color.alpha = 0xff | 0xff << 8; // no transparency in Color yet

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 @@ XGlyphInfo info;

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); }