Re: About patterns in cells and graphs



On Sat, Jul 12, 2003 at 01:45:40PM +0200, Jean Brefort wrote:

I am currently working on using patterns as background in graphs. I 
would like to know if somebody has an opinion about the usefulness to 
allow transparency either for the back or the fore color. It is quite 
possible to do that, just writing a helper function is necessary.

Its an interesting thought, but I'm not sure the semantics of it
would be clear enough to bother.  Would the foreground of the
pattern be blended onto the background then onto the chart ? or
would both go directly on to the chart.  I can't see much use for
this.  Keep it simple for now and just ignore alpha for patterns.

About printing the patterns, it is more difficult, because there is no 
appropriate function in gnome-print although patterns exist both in 
Postscript and PDF; probably someone (I?) should write the corresponding 
code and submit the patch to libgnomeprint (not before 2.5 now).

yah.  we face the same issue up in Gnumeric, and I'd put money on
something like that being the rationale for OOo's lack of patterns.
This is a very artificial constraint, patterns are possible using
even postscript1 level operators (just ugly).  The problem is
gnome-print's use of a subset of ps1.  I'm not sure how large a
problem it would be to extend the g-p interfaces to support patterns
and gradients.  Its tempting to consider Cairo (aka Xr/Xc) as a
better rendering abstraction.  Once its available we could hopefully
ditch GogRenderer too.

At the 
moment, what is possibe to do is filling a pixbuf with the pattern and 
print the pixbuf.
This is a really ugly solution.  Its practical, but ugly.

This is not without problem. The most obvious is a 
resolution one. Gnome-print use 72 dpi, while Gnumeric uses a resolution 
in its configuration, default being 96 dpi.

we also hit this when rendering fonts while zoomed.  I'd hoped to
limit the amount of information necessary.  Gradients aren't really
a problem they scale smoothly.  Its only for patterns and images
that we need to somehow map pixel sizes to screen/printer space.
The goal is to keep zoom=1 pixbuf fills fast, so I'll tack on some
mapping routines that will let us map from that coordinate space
back into pts.
 
Also, before writing the code, I looked at the corresponding code for 
cells background. I found one problem: if the pattern is not solid or 
grey, the cell is printed as a black rectangle since 
gnome_print_setrgbcolor is not called. I suggest to use the back color 
in such cases.
Good idea.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]