[cairo] [Fwd: Re: Uniform Line Widths]

Behdad Esfahbod behdad at behdad.org
Fri Feb 22 12:16:50 PST 2008

On Fri, 2008-02-22 at 13:38 -0500, Bill Spitzak wrote:
> I think what is being requested here is that the pen not change when the
> ctm changes. Instead the pen is transformed by the ctm at the moment it
> is specified and remains constant size after that. Currently the pen is
> transformed by the ctm each time it is used.
> I would also like to see this (along with a matching fix for fonts,
> which I consider a good deal more important as it is currently
> impossible to use the Cairo ctm to position labels without also
> transforming the text). Carl certainly discussed it too and was thinking
> of making this change but this was dropped?


We all very well remember this issue.  Last time Carl started doing a
patch but there were unresolved issues, so this was dropped.  You are
more than welcome to prepare a patch.

Back to the thread, I think Bobby's questions was in fact what I
answered.  His main goal was to get a circle pen instead of an ellipse.


> Problems:
> 1. It does not match PostScript/PDF. This would require the CTM to be
> applied by the cairo PDF/PostScript backend rather than transforms being
> sent unchanged through.
> 2. It is not compatable with the current Cairo (however it is possible
> that the set of things it is incompatable with is very small or that
> they are producing the wrong output now and the users have not noticed).
> Or a switch can be provided as part of the graphics state.
> 3. Need an api to query and set the line width using a 2x2 matrix.
> Advantages:
> 1. It matches almost every other graphics api that is not based on
> PostScript, such as GDI+
> 2. It is a lot more useful, as it allows the CTM to be used for other
> purposes than just scaling a page to fit in a window. For instance an
> illustrator type program can use the cairo transforms.
> 3. It may be more efficient to implement as things can be turned into
> device resolution immediately and stored that way.
> 4. It is pretty much a requirement if the CTM is ever expanded to allow
> 3D or other non-affine transforms.
> Bobby Salazar wrote:
> > Ok, that is much simpler than I thought, and works good too.
> > 
> > However, my code is written so that the pre-set line width is correct for the currently applied transformation matrix. If I then set the transformation matrix to be the identity matrix, the line width is not correct. Is there an equally simple method of mapping a certain line width from any arbitrary transformation matrix into the same pixel sized width it would if the identity matrix were used? I hope that last sentenced makes sense...
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list