[cairo] Write ups on Microsoft Avalon

Bill Spitzak spitzak at d2.com
Mon May 17 11:54:28 PDT 2004

On Monday 17 May 2004 10:09 am, Carl Worth wrote:
> One feature in cairo to help with this issue is the default user->device
> transformation which is close to:
>         1 user-space unit == 1/96 inch
> but is actually rounded so that:
>         1 user-space unit == an integer number of device-space pixels
> So, it's quite easy to align elements to pixel boundaries. For example,
> even integer stroke widths, half-unit offsets, and integer scale factors
> will all help here.

Can you confirm that the default transformation also puts integers at the 
corners of pixels, not in the center? It appears to be the case but I'm not 
sure if this has really been stated.

I personally feel that this is vitally important, plus there must be 
something in the documentation to discourage people from "fixing" it by 
moving the CTM by .5. This thinking completely broke the tNt toolkit for NeWS 
and destroyed it's ability to make a scale-independent user interface, 
because people started to draw rectangles assumming they would end up .5 
pixel larger than they drew them, and making assumptions about how rectangles 
would line up with image and font pixels that did not scale.

                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com

More information about the cairo mailing list