On Wed, 15 Jun 2005, Austin Ziegler wrote: > Well, things have just gotten ... interesting. In response to a user's > request, I'm looking at possibly doing SVG-to-PDF vector transformations > with PDF::Writer. In looking over the existing code, I realised that there's > some bugs in the axis transformation code related to how rotation and > skewing is done. The skewing is completely wrong. The rotation is also > completely wrong, but it's a much more subtle issue. > > See, I have the transformation *backwards* in the text rotation. Without > going into much detail as to *why*, rotation code is supposed to be on a > vector of: > > [ cos(a) sin(a) -sin(a) cos(a) 0 0 ] > > The *text* rotation code, on the other hand, is: > > [ cos(a) -sin(a) sin(a) cos(a) 0 0 ] > > This inversion *reverses* the direction of the angle. > > Consider an analog clock. In both systems, zero degrees is at the three > o'clock position. Under the current text rotation, 90 degrees is at the six > o'clock position (headed DOWN the page); under the common transformation, it > is at the 12 o'clock position (headed UP the page). > > PDF::Writer 1.0 has been released with this behaviour. Changing it will be > very simple ... but it will break anyone's code that uses angles. At the > same time, if I use the broken transformation, then I have to work harder at > things like SVG or RVG transformations. I'm definitely between a rock and a > hard place here. The longer I wait to fix this, the more people that will be > affected by it. > > I want the text angle and the graphics axis angle to mean the same thing > (either clockwise or counter-clockwise). > > I'm looking for advice, people. I'm tempted to release 1.1 with this fix; > it's incompatible behaviour but compatible API, and the only change > necessary to your code would be to *negate* the angle. i've been releasing all my code like lib.rb -> is a link to lib-1.3.4.rb lib-1.3.4.rb -> requires a bunch stuff from the __directory__ lib-1.3.4/* therefore a require 'lib' always gets the most recent lib while a require 'lib-1.3.4' will pin an application to a specific version with this approach you can release a new version that supports multiple installs and completely eliminate issues like this... that's one answer. the other is - make it right! PDF::Writer is some great stuff and the better/more-correct it is the more widespread it will become. 2cts. cheers. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | My religion is very simple. My religion is kindness. | --Tenzin Gyatso ===============================================================================