From 955d9d8e3048d04edb8986bfe7693e659204eae3 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 21 May 2003 22:19:01 +0000 Subject: [PATCH] optimize it a bit --- render/font.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/render/font.c b/render/font.c index 9d3a1321..db4e8483 100644 --- a/render/font.c +++ b/render/font.c @@ -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; } -- 2.44.0