[cairo] Re: Some thoughts on metadata

Carl Worth cworth at cworth.org
Mon May 1 12:30:42 PDT 2006


On Mon, 01 May 2006 13:56:08 -0400, Michael Sweet wrote:
> 
> WRT orientation, I would say that it is sufficient to allow the
> developer to change the page size to be a landscape aspect ratio
> to indicate the orientation, and/or do rotation.  That is
> sufficient to achieve 0, 90, 180, and 270 degree rotations.

The orientation control is something that left me quite confused as I
tried studying it this weekend.

There's obviously a difference between page-feed direction, (that is a
printer tray could provide short-edge or long-edge first), and logical
content orientation, (the direction to present the page to a human
viewer so it looks correct).

I notice that PostScript/DSC provide per-page PageOrientation control
but with values of only "Portrait" or "Landscape". Meanwhile PDF does
provide a Rotate option that can accept any multiple of 90 degrees.
Additionally, it's quite obvious that there are PPD options that
control orientation as well.

So what I'm left wondering is what is the right way to generate a
PostScript file that has multiple orientations in it. For example,
given a page size of SHORTxLONG should cairo generate all pages with
the same bounding box of [0 0 SHORT LONG], say, and then include hints
to allow viewers to properly rotate things for humans?

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?

These are the kinds of issues that cannot easily be answered by an
appeal to the reference manuals, (as far as I can find). And the right
answer might actually be different in different situations.

Due to this kind of complexity, what I'm currently working on for
cairo, (and about to propose properly with a patch), is a fairly
low-level API that allows cairo to not need to know any of the answers
to this stuff. The idea is to provide access for the application to
basically directly emit DSC comments. This should let us have an
implementation of the cairo API that we can commit to today, and then
things like GTK+ can acquire the smarts needed to use that API to get
the right answer.

I'll be back with something more concrete as soon as I can.

-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/7ff2c2e7/attachment.pgp


More information about the cairo mailing list