[cairo] Re: Some thoughts on metadata
Carl Worth
cworth at cworth.org
Mon May 1 13:10:40 PDT 2006
On Mon, 01 May 2006 15:58:36 -0400, Michael Sweet wrote:
>
> > Or should cairo generate pages with both [0 0 SHORT LONG] and [0 0
> > LONG SHORT] for the bounding boxes? That would let viewer applications
> > do the obvious thing and users would see the correct result. And then
> > would CUPS step in and rotate the content as necessary so that the
> > printer receives the content it needs?
>
> Yes, and this is the way I would recommend you do it since there
> are printers that print on landscape media (that is, the long edge
> is the leading edge...) and you need to support both types of
> devices. Using SHORT LONG for portrait and LONG SHORT for
> landscape is guaranteed to work in all circumstances.
Thanks. It's very helpful to get solid advice like this.
With this approach, and given a document that has both portrait and
landscape pages in it, would the header comment be:
%%BoundingBox: 0 0 LONG LONG
Since it is specified as "the bounding box that encloses all marks
painted on all pages of a document"?
> If you want to get fancy, you can add a rotation angle parameter
> to the size API, e.g.:
>
> cairo_set_page_size(float width, float height, int rotation);
>
> where "rotation" can be 0, 90, 180, or 270. All you'd need to do
> is initialize the CTM to the proper matrix (identity for 0 degrees).
I think I won't since this could then pass the ambiguity I'm currently
resolving with you on to the user of the cairo API. (Should I use
long,short,0 or short,long,90? Are the names of width,height
interpreted before or after rotation?). I think it will make it much
easier to use if we just provide a page_size API of (width,height) and
always set the initial CTM to put the origin in a consistent spot on
the page, (which for cairo is the upper-left corner).
-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060501/af06460a/attachment.pgp
More information about the cairo
mailing list