Scott Moore wrote:

> Klaus,
> 
> Could you give me an example of the transformations you used?  Right now,
> I'm just specifying the width and height in inches and more or less guessing
> the number of pixels in my view area.  Not the most robust way to do it.
> 
> Thanks,
> Scott


Well, I just assumed that one unit in the user space would correspond to one 
point, i.e. a 1/72 inch. If the viewbox is "x y w h" and I want to have the 
graphic at a size of width W and height H (converted to points), then I can 
use the following transformation


   transform="scale(W/w, H/h) translate(-x,-y)"


of course, you have to replace the expressions with the precalculated values.

I just re-read the SVG spec and saw that the assumption above (1 unit = 1 pt) 
is not correct, although it seems to be o.k. in FOP. SVG/CSS says that the 
default unit is one pixel if no viewport/size is specified, whereas the 
definition of "one pixel" is device dependent. There is some description how 
the abstract size of a pixel should be determined on non-raster oriented media 
(like PDF), but I don't know to what conclusion the FOP/SVG integrators came to.

By the way, to avoid the problem completely, I suggest to use absolute units e.g.

   <circle cx="50pt" cy="50pt" r="49pt"/>

(never tried this with FOP, in addition it may become a bit problematic if you
attempt to scale such graphics via a transformation)


Klaus


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to