From: Andrew R. <and...@us...> - 2008-11-19 15:10:59
|
On Wed, Nov 19, 2008 at 03:38:37PM +0100, Werner Smekal wrote: > Hi all, > > so I commited the change to the cairo driver by adding a new function > filled_polygon(). You can play around with the width of the stroke by > changing this line: > > cairo_set_line_width(aStream->cairoContext, 1.0); > > A width of 1.0 is good for shade plots without transparency. Example 30 > doesn't look that good (but not worse than before). I couldn't find a > good width for example 30. > > Actually the solution to this problem should be > > http://www.cairographics.org/manual/cairo-context.html#cairo-push-group > > where our case is described. Here we draw the fill and the stroke opaque > in the same color in an intermediate buffer and then draw this buffer > with a transparency into the image. Sounds nice, but has some > disadvantages: > > 1) the driver gets unbearable slow > 2) example 30 doesn't look better because of this :) > 3) the pdf file size of example 30 increases from 8 to 200kB. > > I commited the code, but commented it. In order to test it in cairo.c > you would need to comment line 795 and uncomment line 796. Also > uncomment line 798, 801, 802. So in theory this should solve our problem > but actually it does not. Now we need to discuss if we keep this stroke > around the polygons or revert to the old code. Werner, I've tested your fix, which works fine and solves all the problems for the examples I've looked at, except example 30 which suffers from the transparency problem. The only downside is that is seems to roughly double the size of the postscript files. This seems an awful lot, but is probably a price worth paying for better results. Andrew |