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

Bug #16925 Angled text improperly displayed in SVG.
Submitted: 2009-12-18 22:18 UTC
From: daveo Assigned:
Status: Open Package: Image_Canvas (version 0.3.2)
PHP Version: 5.3.1 OS: Debian Etch
Roadmaps: (Not assigned)    
Subscription  


 [2009-12-18 22:18 UTC] daveo (Stephen Chow)
Description: ------------ Angled text improperly displayed in SVG. It will appear upside down. Test script: --------------- see line 756 to SVG.php in 0.3.2 version: 'transform="rotate(' . (($this->_font['angle'] + 180) % 360) . ')" ' : The "+ 180" will only work in correctly displaying text vertically -- readable from bottom to top. Text angled at 45 will appear upside down. Expected result: ---------------- text appears at 45 readable from laft to right Actual result: -------------- text (readable from left to right) is rotatated an additional 180

Comments

 [2009-12-18 22:51 UTC] daveo (Stephen Chow)
This is a quick fix: 'transform="rotate(' . (($this->_font['angle'] - (90 * ($this->_font['angle'] / 45)) ) % 360) . ')" ' : There's probably a better way. Hope guys can think of one.
 [2009-12-20 18:16 UTC] doconnor (Daniel O'Connor)
Are you able to provide a small executable test case to demonstrate this bug?
 [2009-12-24 18:48 UTC] daveo (Steve Cho)
Use the code I posted here, in response to your identically phrased request: https://pear.php.net/bugs/bug.php?id=16929&thanks=3
 [2009-12-24 18:51 UTC] neufeind (Stefan Neufeind)
-Status: Open +Status: Analyzed
You are right. Rotation is in a different direction between GD and SVG, I've already tried that out and thought of a fix. While that I discovered that also font-sizes are way off between GD (GD2 uses point, here in SVG pixels are used as also included in the apidoc). I'll try to come up with a commit fixing the text-behavior soon. Just sent a call-for-comments to the pear-dev-ML regarding "BC-breakage" for those two cases a few days ago.
 [2009-12-27 00:34 UTC] neufeind (Stefan Neufeind)
-Status: Analyzed +Status: Feedback
Thank you for taking the time to report a problem with the package. This problem may have been already fixed by a previous change that is in the CVS of the package. Please log into CVS with: cvs -d :pserver:cvsread@cvs.php.net:/repository login and check out the CVS repository of this package and upgrade cvs -d :pserver:cvsread@cvs.php.net:/repository co pear/Image_Canvas pear upgrade pear/Image_Canvas/package2.xml or pear upgrade pear/Image_Canvas/package.xml If you are able to reproduce the bug with the latest CVS, please change the status back to "Open". Again, thank you for your continued support of PEAR. Could you please retry with the latest version of Image/Canvas/SVG.php from SVN? Commited a first fix. But that might need further testing (e.g. with multiline-text etc.)
 [2009-12-31 19:14 UTC] daveo (Steve Cho)
What's the CVS login password for cvsread user?
 [2010-01-13 20:34 UTC] daveo (Steve Cho)
-Status: Feedback +Status: Open
I don't know if I should open a new bug or continue this one, because I believe the fixes made created new bugs. The SVG text alignments are now wrong as well as the colour of the axis text.
 [2010-01-13 20:39 UTC] daveo (Steve Cho)
oh yeah. I forgot to confirm that your fixes did fix the angle problem. Thanks! You can reuse the code I posted earlier to re-test the new problem I mentioned in my previous post.