This breaks on current ports on 7.1-BETA2 prob cos of a new release of mpoint. ----------- FreeBSD-7.2 ports uses magicpoint-1.13a & this patch doesnt apply, bits of the patch approx recognisable in the new code, so it probably made it. TODO Test functionality then assume patch not needed. ------------ To: Yoshifumi Nishida cc: mgp-users @ wide.ad.jp Subject: Re: [mgp-users 1489] Re: Magicpoint loops forever rendering single word longer than line In-reply-to: <20070531.023736.104056876.nishida @ csl.sony.co.jp> References: <200705211607.l4LG7M5J081695 @ fire> <20070524.011226.85411619.nishida @ csl.sony.co.jp> <20070531.023736.104056876.nishida @ csl.sony.co.jp> Comments: In-reply-to Yoshifumi Nishida message dated "Thu, 31 May 2007 02:37:36 +0900." Date: Fri, 01 Jun 2007 00:34:27 +0200 From: "Julian H. Stacey" Yoshifumi Nishida wrote: > > Hello Julian, > > > From: "Julian Stacey" > > Subject: [mgp-users 0] Magicpoint loops forever rendering single word longer than line > > Date: Mon, 21 May 2007 18:07:22 +0200 (CEST) > > Message-ID: <200705211607.l4LG7M5J081695 @ fire> > > > > > Hi Magicpoint users, > > > The following applies to both mgp version 1.11b (20040925) > > > on FreeBSD-6.1 & also mgp 12 on FreeBSD-6.2 > > > > > > A couple of bugs/ features/ problems I've noticed: > > > - All filters I suspect get called at beginning. > > > - If a single long word longer than page width (eg a URL), > > > it loops forever rendering. (cludge solution: reduce %size) > > Please try the following patch. > > Thanks, > -- > Yoshifumi Nishida > nishida @ csl.sony.co.jp I confirm this patch works on magicpoint-1.11b on FreeBSD 6.2-RELEASE i386. By works I mean - mgp no longer hangs before page with long single word line (eg URL)., - mgp auto folds lonh line, so I don't lose right end of text - I can step pages past the text line that is too long & page to end & back again, Well done, Thanks Yoshifumi ! I hope you'll commit it into next release of mgp :-) (meantime I'll be applying it to any compile I do) Julian > > > diff -c -r1.233 draw.c *** draw.c 21 May 2007 10:15:19 -0000 1.233 --- draw.c 30 May 2007 17:31:33 -0000 *************** *** 5215,5226 **** if (isspace(*(p + len -1))) { XftTextExtents8(display, xft_font, (XftChar8 *)p, len -1, &extents); if (state->width - state->leftfillpos / 2 - state->linewidth >= extents.xOff) goto nofolding; } ! draw_line_end(state); ! draw_line_start(state); ! state->linewidth = state->leftfillpos; ! return p; } nofolding: --- 5215,5242 ---- if (isspace(*(p + len -1))) { XftTextExtents8(display, xft_font, (XftChar8 *)p, len -1, &extents); if (state->width - state->leftfillpos / 2 - state->linewidth >= extents.xOff) goto nofolding; + draw_line_end(state); + draw_line_start(state); + state->linewidth = state->leftfillpos; + return p; } ! for (i = 2; i < len; i ++){ ! XftTextExtents8(display, xft_font, (XftChar8 *)p, len -i, &extents); ! if (state->width - state->leftfillpos / 2 - state->linewidth >= extents.xOff){ ! len -= i; ! break; ! } ! } ! draw_line_itemsize(state, xft_font->ascent, xft_font->descent, 0); ! if (obj_new_xftfont(state, state->linewidth, state->charoff, p, len, fontname, ! registry, char_size[caching], charset16, xft_font)) { ! draw_line_end(state); ! draw_line_start(state); ! state->linewidth = state->leftfillpos; ! return p +len; ! } else ! return NULL; } nofolding: -- Julian Stacey. Munich Computer Consultant, BSD Unix C Linux. http://www.berklix.com 31.05.2007 = No Smoking Day : http://who.int Half the people who smoke regularly will be killed by tobacco.