[Xr] Axis orientation.

David Lazaro dlazaro at acm.org
Wed Jun 11 03:17:16 PDT 2003


> >  > >    Do you plan to add the ability to choose the Y-axis
orientation?
> >  >
> >  > You should be able to do that yourself.
> >
> > Yup, XrScale(xrs, 1, -1) will reverse Y. Of course, one will also
need
> > to XrTranslate() the origin as appropriate.
> 
>   That is not so easy. You cannot change orientation with simple
transform
> matrix. When I do XrScale(xrs, 1, -1), I will get text drawn
upsideDown,
> also I think images will be drawn upsideDown. So text will have to be 
> handled specially, which is not quite trivial when you have text
rotation
> and textalignment.

Yes, it is. Text and glyph coordinates have their own spaces in PDF. In
order to change the orientation of actual glyphs you must change the
text and line matrix using the "Tm" operator.  Not that it has been
implemented in Xr yet but well...

Other drawings will appear upside down but you can change the CTM
(Current Transformation Matrix) before drawing a metafile, for example.
That would be PDF's "cm" operator.

And both of these matrices are independent, as you can see one's
contents don't affect the other.

>   When I try to visualize my drawing, I always see the y-axis up, all
> geametry in school is done with that axis layout, it is natural for
me.
>   So I think you should consider adding the possibility to choose
y-axis
> orientation.

So XrScale(xrs, 1, -1) is your friend, at least for now.

In PostScript, the origin of the default user space is on the lower
right too.  The PDF spec changes that by requiring the definition of the
default user space in the "CropBox" entry of the page dictionary.  Don't
know what will be the way final way in which Xr will treat it, though.

Regards,

David.





More information about the cairo mailing list