Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13756 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2993 invoked by uid 1010); 6 Nov 2004 18:31:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2927 invoked by uid 1007); 6 Nov 2004 18:31:10 -0000 Message-ID: <20041106183110.2926.qmail@pb1.pair.com> To: internals@lists.php.net References: <20041106062158.78783.qmail@pb1.pair.com> Date: Sat, 6 Nov 2004 19:30:59 +0100 Lines: 40 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Posted-By: 212.238.144.71 Subject: Re: Idea for underlining in GD text functions From: r.korving@xit.nl ("Ron Korving") Shouldn't you better discuss this with the gd people over at boutell.com? Ron "Tim Toohey" wrote in message news:20041106062158.78783.qmail@pb1.pair.com... > I've had a need to draw underlines in text created with the GD image > functions, specifically ImagePSText(). As far as I could tell there's no > way to do this (apart from using ImageLine(), which would be difficult to > really get right). [I'm happy to hear suggestions if I've missed the > obvious :-)] > > An added complication of what I wanted to achieve was to underline only part > of the string being drawn, while maintaining kerning between characters. > > The system I've come up with is to embed "control sequences" into the string > that is passed to ImagePSText(). A control sequence contains commands which > change various characteristics of the output, for instance, toggle > underlining. I'm currently using the escape character (chr(27)) to indicate > the start of a control sequence, and a semi-colon to end the sequence. > > For example: > $str="Some text with an " . chr(27) . "u;underlined" . chr(27) . "u; word"; > > I've attached a patch for gd.c which does what I'm talking about. > > I wondering whether people think this is a good way to go, and if so if I > should commit this code? If it's not a good idea, any suggestions for > drawing underlines? > > Thanks, > Tim >