PDF::Writer Angle Issues

A

Austin Ziegler

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.

-austin
--=20
Austin Ziegler * (e-mail address removed)
* Alternate: (e-mail address removed)
 
K

kjw

On 14/06/05 said:
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.
=20
-austin

Hello Austin,

For what it's worth, I prefer a point release with an incompatible
change (but compatible API) than a major release some time down the
road with an incompatible change (and enough people having complained
about it that the new API is incompatible).

Just my CAD0,02 worth.

Cheers,

kjw

--=20
http://www.kjwcode.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top