]> Dogcows Code - chaz/openbox/commitdiff
use the byte size for utf strings, not the character size
authorDana Jansens <danakj@orodu.net>
Mon, 13 Jan 2003 10:33:16 +0000 (10:33 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 13 Jan 2003 10:33:16 +0000 (10:33 +0000)
otk/font.cc

index a9f2fd3ee352e41220a7b49bfcd2e80a5e9e4edc..a51e158c1613fa92d898b31a6c19a0aa8968e429 100644 (file)
@@ -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);
 }
This page took 0.023612 seconds and 4 git commands to generate.