FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=18507&edit=1

ID: 18507
Updated by: daniel.oconnor@gmail.com
Reported By: jblank at twu dot net
Summary: SVG output of multi-line axis labels is screwed up.
Status: Analyzed
Type: Bug
Package: Image_Canvas
Operating System: Debian
Package Version: 0.3.3
PHP Version: Irrelevant
Assigned To: nosey
Roadmap Versions:
New Comment:

@Nosey - I'm marking this package unmaintained for the moment; and am
just
going to apply this / other patches as needed.


Previous Comments:
------------------------------------------------------------------------

[2011-05-29 14:05:16] doconnor

-Assigned To:
+Assigned To: nosey


------------------------------------------------------------------------

[2011-05-29 14:04:45] doconnor

-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-18 07:44:01] jessieleah

Added #patch
bug:18507;patch:fix_multiline_axis_labels.patch;revision:1305704641;.

------------------------------------------------------------------------

[2011-05-06 04:53:35] jessieleah

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.

------------------------------------------------------------------------

Search Discussions

  • Daniel Oconnor at Jan 2, 2012 at 12:41 am
    Edit report at https://pear.php.net/bugs/bug.php?id=18507&edit=1

    ID: 18507
    Updated by: daniel.oconnor@gmail.com
    Reported By: jblank at twu dot net
    Summary: SVG output of multi-line axis labels is screwed up.
    -Status: Analyzed
    +Status: Closed
    Type: Bug
    Package: Image_Canvas
    Operating System: Debian
    Package Version: 0.3.3
    PHP Version: Irrelevant
    -Assigned To: nosey
    +Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    -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);


    Previous Comments:
    ------------------------------------------------------------------------

    [2012-01-01 23:39:34] doconnor

    @Nosey - I'm marking this package unmaintained for the moment; and am
    just
    going to apply this / other patches as needed.

    ------------------------------------------------------------------------

    [2011-05-29 14:05:16] doconnor

    -Assigned To:
    +Assigned To: nosey


    ------------------------------------------------------------------------

    [2011-05-29 14:04:45] doconnor

    -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-18 07:44:01] jessieleah

    Added #patch
    bug:18507;patch:fix_multiline_axis_labels.patch;revision:1305704641;.

    ------------------------------------------------------------------------

    [2011-05-06 04:53:35] jessieleah

    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.

    ------------------------------------------------------------------------
  • Daniel Oconnor at Jan 2, 2012 at 12:45 am
    Edit report at https://pear.php.net/bugs/bug.php?id=18507&edit=1

    ID: 18507
    Updated by: daniel.oconnor@gmail.com
    Reported By: jblank at twu dot net
    Summary: SVG output of multi-line axis labels is screwed up.
    Status: Closed
    Type: Bug
    Package: Image_Canvas
    Operating System: Debian
    Package Version: 0.3.3
    PHP Version: Irrelevant
    Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    See also
    Bug #16948


    Previous Comments:
    ------------------------------------------------------------------------

    [2012-01-02 01:41:53] doconnor

    -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-01 23:39:34] doconnor

    @Nosey - I'm marking this package unmaintained for the moment; and am
    just
    going to apply this / other patches as needed.

    ------------------------------------------------------------------------

    [2011-05-29 14:05:16] doconnor

    -Assigned To:
    +Assigned To: nosey


    ------------------------------------------------------------------------

    [2011-05-29 14:04:45] doconnor

    -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-18 07:44:01] jessieleah

    Added #patch
    bug:18507;patch:fix_multiline_axis_labels.patch;revision:1305704641;.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18507

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJan 1, '12 at 10:39p
activeJan 2, '12 at 12:45a
posts3
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 3 posts

People

Translate

site design / logo © 2022 Grokbase