[cairo] Serious concerns about cairo
Bertram Felgenhauer
bertram.felgenhauer at googlemail.com
Wed Sep 27 01:10:59 PDT 2006
Bill Spitzak wrote:
> The biggest problem I have with Cairo is the fact that the pen and font
> is changed by the current transform
I don't see that as much of a problem. This is exactly what I need
when I want to, say, transform an SVG and let the rendering be done by
a different library (librsvg, say). I'd expect that to be a common
use case.
Also, as Carl keeps pointing out, you can set the transformation for a
path, create the path, and then reset it for the pen to use, without
changing the path.
Maybe having separate matrices for both is the way to go, at the risk
of API explosion (you'll need at least a backward compatible interface
that affects both transformations and something that affects them
separately).
> And the lack of a "hairline" mode.
I suppose that one is actually useful.
> II. Proposed fix for "hairline" mode:
>
> Currently any software that wants to draw anything like this cannot use
> Cairo's transforms. Also the thick-or-blurry lines by default really
> annoy new users of Cairo.
I thought the main thing to figure out is that on an image surface
with identity transform, (0,0) is the corner of a pixel and for lines
you usually want to start at the center of a pixel instead.
> * Setting the line width to zero (or setting the pen to a degenerate
> matrix) puts Cairo into "hairline" mode. Setting the pen to a non-zero
> size (including negative) turns off hairline mode.
I too would like to see a separate API for that. Using zero line width
or even negative line widths (which would be the next obvious idea) is
a dirty hack in my opinion. Degenerate matrices are even worse. How
close to zero would the determinant have to be?
regards,
Bertram
More information about the cairo
mailing list