[cairo] API Shakeup: default matrix

Carl Worth cworth at cworth.org
Mon Feb 21 07:28:02 PST 2005


So, once Owen was able to corner Keith and I at the same time in a
room, he was able to convince us that our specification for the
default matrix, (1 user unit == 1/96 inch, but rounded to an integer
number of device pixels > 0), really is a crazy idea.

The problem is that this specification declares years in advance, that
we will have a sudden change in the way cairo renders things, (when
the default matrix jumps from 1 unit == 1 pixel to 1 unit == 2
pixels). And this sudden change will be in response to a slow and
gradual function, (increasing pixels-per-inch in available displays).

Since we know what we want today, (1 unit == 1 pixel, given displays
of roughly 100 pixels-per-inch), it seems the most sane approach is to
simply specify that the default matrix for display surfaces is exactly
this. If we want to do something different with higher resolution
display devices, we will be free to decide that when the time comes,
rather than preemptively.

Then, for print devices we will continue to provide a real-world-unit
based default matrix. This can now be specified in the more natural
units of PostScript points (1/72 inch) rather than 1/96 inch.

So, to summarize, here's an initial attempt at a documentation
paragraph on the default matrix. It does introduce a distinction
between "display" and "print" devices, but that seems fairly
reasonable to me.

	The default transformation matrix is setup in the following
	ways for all devices:

		The user-space origin maps to the upper-left corner of
		the device output space.

		The positive X axis points to the right in device
		space.

		The positive Y axis points down in device space.

	The scaling of the default matrix is setup differently for
	display and print devices:

		For display devices, the default matrix maps one
		user-space unit to the length of one device-space
		pixel.

		For print devices, the default matrix maps one
		user-space unit to a length of one PostScript point
		(1/72 inch).

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


More information about the cairo mailing list