]> Dogcows Code - chaz/openbox/commitdiff
optimize it a bit
authorDana Jansens <danakj@orodu.net>
Wed, 21 May 2003 22:19:01 +0000 (22:19 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 21 May 2003 22:19:01 +0000 (22:19 +0000)
render/font.c

index 9d3a1321a2842d1a5de56e621e8ed31dffe89d4f..db4e8483fee4cf4bb29be3e2a134f70f6fbd4e41 100644 (file)
@@ -151,6 +151,8 @@ void font_draw(XftDraw *d, TextureText *t, Rect *position)
         break;
     }
 
+    l = strlen(text->str); /* number of bytes */
+
     if (t->shadow) {
         if (t->tint >= 0) {
             c.color.red = 0;
@@ -167,7 +169,7 @@ void font_draw(XftDraw *d, TextureText *t, Rect *position)
         }  
         XftDrawStringUtf8(d, &c, t->font->xftfont, x + t->offset,
                           t->font->xftfont->ascent + y + t->offset,
-                          (FcChar8*)text->str, strlen(text->str));
+                          (FcChar8*)text->str, l);
     }  
     c.color.red = t->color->r | t->color->r << 8;
     c.color.green = t->color->g | t->color->g << 8;
@@ -177,6 +179,6 @@ void font_draw(XftDraw *d, TextureText *t, Rect *position)
                      
     XftDrawStringUtf8(d, &c, t->font->xftfont, x,
                       t->font->xftfont->ascent + y,
-                      (FcChar8*)text->str, strlen(text->str));
+                      (FcChar8*)text->str, l);
     return;
 }
This page took 0.026391 seconds and 4 git commands to generate.