[cairo] Problems with cairo_get_line_width and "new" semantics

Bill Spitzak spitzak at d2.com
Fri May 19 18:06:40 PDT 2006


Actually I missed something in your email:

It sounds like it will be a pita to emulate Cairo's output on PS/PDF 
(and perhaps other devices that do their own dashes) unless the pen and 
dash ctm are always identical. For this reason I would delete the 
seperate transforms.

I also think the "dashscale" I proposed earlier does not require any new 
api, as it could be a hidden internal variable with no direct way to 
get/set it. set_pen_matrix() would set dashscale to 1, while 
set_line_width would set it to 1/width. When setting the dash pattern, 
it is multiplied by dashscale before being stored.

Anoter possibility is to be incompatible and make the dash pattern 
always be measured in pen widths.

Bill Spitzak wrote:

> If, as you indicate, having a different dashCTM and penCTM is not any 
> harder than using penCTM for everything, then probably there should be a 
> call to set the dashCTM. This would replace the "dashscale" I proposed 
> earlier. To emulate the set-pen-width call, it would copy the CTM to 
> dashCTM, and scale it up by the width and put that in the penCTM. It may 
> also be a good idea to have set_pen_matrix() always set the dash matrix 
> to the same value, to avoid two calls in the common case where they want 
> to be the same.


More information about the cairo mailing list