Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.0

Bug #18507 SVG output of multi-line axis labels is screwed up.
Submitted: 2011-05-06 08:53 UTC
From: jessieleah Assigned: doconnor
Status: Closed Package: Image_Canvas (version 0.3.3)
PHP Version: Irrelevant OS: Debian
Roadmaps: (Not assigned)    
Subscription  


 [2011-05-06 08:53 UTC] jessieleah (Jessica Blank)
Description: ------------ See screenshots. If you output an SVG with multi-line axis labels (on the X axis, at least), it incorrectly shoves the START of the label down a little bit more for each line of length of the label. For instance, the label "Test\nLabel\nOne" is three lines, so it would be shoved down further than the label "Testlabel\nTwo", which is two lines long. SIMPLE FIX: In SVG.php, instead of: $textHeight = $this->textHeight($text); go: $lines = explode("\n",$text); $textHeight = $this->textHeight($lines[0]); Voila. Expected result: ---------------- Labels should line up. Actual result: -------------- Labels do not line up.

Comments

 [2011-05-18 11:44 UTC] jessieleah (Jessica Blank)
 [2011-05-29 18:04 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Analyzed
Thanks for the patch Jessica. You mentioned screenshots - can you put them on imgur or something and link to this ticket by any chance?
 [2011-05-29 18:05 UTC] doconnor (Daniel O'Connor)
-Assigned To: +Assigned To: nosey
 [2012-01-02 04:39 UTC] doconnor (Daniel O'Connor)
@Nosey - I'm marking this package unmaintained for the moment; and am just going to apply this / other patches as needed.
 [2012-01-02 06:41 UTC] doconnor (Daniel O'Connor)
-Status: Analyzed +Status: Closed -Assigned To: nosey +Assigned To: doconnor
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Applied to git. There's a few other drivers that just rely on text. Is it safe to assume these are not affected? clockwerx@clockwerx-desktop:~/pear-svn-git/Image_Canvas$ ack-grep -a "\- \>textHeight" Image/Canvas/GD.php 1424: $h0 = $this->textHeight($text); 1543: $textHeight = $this->textHeight('A'); 1571: $height = $this->textHeight($line); 1587: $y + $this->textHeight($text), Image/Canvas/SVG.php 743: $textHeight = $this->textHeight($text); Image/Canvas/PDF.php 851: $textHeight = $this->textHeight($text); Image/Canvas/PS.php 845: $textHeight = $this->textHeight($text); Image/Canvas/SWF.php 689: $textHeight = $this->textHeight($text); 728: $height = $this->textHeight($line);
 [2012-01-02 06:46 UTC] doconnor (Daniel O'Connor)
See also Bug #16948