From 763f1867056f266e3bf702e58e4e373a931fac26 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Wed, 17 Sep 2003 12:57:43 +0000 Subject: [project @ 2003-09-17 12:57:33 by bursa] Poll queuing fix, backup redraw code. svn path=/import/netsurf/; revision=296 --- debug/fontd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'debug/fontd.c') diff --git a/debug/fontd.c b/debug/fontd.c index f4537c238..2d6e3a51f 100644 --- a/debug/fontd.c +++ b/debug/fontd.c @@ -152,8 +152,16 @@ void font_close(struct font_data *data) char * font_split(struct font_data *data, const char * text, unsigned int length, unsigned int width, unsigned int *used_width) { - *used_width = width; + int i = width / 10; - return text + (width / 10); + if (length < i) { + *used_width = length * 10; + return text + length; + } + + for (; i != 0 && text[i] != ' '; i--) + ; + *used_width = i * 10; + return text + i; } -- cgit v1.2.3