[cairo] Line widths and coordinate system transformations

Bill Spitzak spitzak at thefoundry.co.uk
Mon Jun 9 02:56:21 PDT 2008


There is also a proposal to change how Cairo works so that the pen (and 
probably also the font) does not change when you change the ctm. This 
would make it far easier to achieve the result you expect, with a lot 
less code. It would also make the pen and font match how Cairo handles 
the path, clip, and source image.

The problem is that it is not compatible, and it is difficult to figure 
out what Cairo-using code this will break. Certainly the vast majority 
of Cairo code, including the attached code, will work the same. A switch 
could be used to turn this on/off but it would be nice to avoid that, 
mostly because I think backends could be much more efficient if they 
could assume this new behavior.

Holger Berndt wrote:
> Hi Behdad,
> 
>>> Thanks a lot, Dirk and Simon. Having different scalings during path
>>> creation and stroking of course does the trick. Awesome!
>> So to summarize, this is what you want:
>>
>> cairo_save (cr);
>> cairo_identity_matrix (cr);
>> cairo_set_line_width (cr, line_width);
>> cairo_stroke (cr);
>> cairo_restore (cr);
> 
> Yes, that's one way to do it. It's indeed a very flexible way to deal
> with drawing.
> 
> Holger
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


-- 
Bill Spitzak, Senior Software Engineer
The Foundry, 1 Wardour Street, London, W1D 6PA, UK
Tel: +44 (0)20 7434 0449 * Fax: +44 (0)20 7434 1550 * Web: 
www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027



More information about the cairo mailing list