Re: Printing lines, shapes and pixmaps from a gnome canvas



On Sun, 2003-01-26 at 03:43, Jean Bréfort wrote:
> Chema Celorio wrote:
> ...
> >to tweak with great detail the print output. The rules for displaying
> >something on the screen where you have pixels and on printing where you
> >dealing with vectors is a different problem.
>
> I am not sure it is so different in the case of the canvas. For example, 
> when drawing lines, one  can give the line width in units or in pixels. 
> In the first case, the difference between displaying on the screen and 
> printing is hidden in the appropriate canvas function. The canvas is 
> essentially used for vectorial drawing.

>From the experience with gnumeric, the problem came not from the units
used but when high precision was needed. For example when lines needed
to meet at a common point like cell borders.

> The pagination problem is probably the most important. The canvas cannot 
> decide internally where a new page begin. So what I am writing will be 
> mostly usefull for little applications which do not need more than one 
> page. Nonetheless, it is possible to create a canvas, fill it with the 
> items which are on the page and print it without displaying on the 
> screen (I tried that and it works).

nod.

> It should not go in gnome-print but in libgnomecanvas (IMHO).

Yes you are right, either libgnomecanvas or a different library that
retrofits the print method to the canvas objects.

> >	The only thing that I'd like to see, is if this code was developed as
> >part of an application or developed somewhere where it is getting real
> >life usage before putting it in a library.
> >
>
> I developped this code for use in GChemPaint. If it is not included in 
> an official library I'll include a special canvas version with just what 

I think it would be wise to avoid copying the code to your application,
you can do it if you want but you will end up with a maintenance problem
and others wont be able to benefit from your effort. I know it can be
discouraging to get the ball rolling as a newcomer to a Free Software
projects but believe me, you are on the right track.

> I need in future versions. Current code is based on libgnomecanvas2.0.5 
> and is available at 
>
> http;//jean.brefort.free.fr/info/libgnomeprintablecanvas.tar.bz2 

Great, this changes the issue a lot. I wasn't aware that you where
developing this because you needed the functionality in an application
or just because it would be good to have. Not only that, but you have
working code already, which makes a good test case and a scenario where
this is needed. Is the version of GChemPaint in cvs using this
libgnomepirntablecanvas library?
Also, GChemPaint looks nice. For the benefit of others here is a
screenshot: http://www.nongnu.org/gchempaint/cholesterol.png

I downloaded libgnomeprintablecanvas.tar.bz2 an have a recommendation.

It would be very useful if the filenames where not changed, I wanted to
do a diff with libgnomecanvas to see how much code was changed an how
but because of the filename changes it wasn't possible to do so. Also,
it would be a lot easier to get the code accepted upstream if you where
distributing a patch to libgnomecanvas rather than a tarball. The
smaller the patch becomes the better, change as little as possible
current code, just add the new methods.

Can you make a diff (diff -u5) and then we can start polishing the patch
and start a discussion with a wider audience about where it should go?

As Michael pointed out, the first thing that we need to figure out is if
this code will live inside the canvas or on a separate library that
retrofits the print method to canvas objects. What are your thoughts on
having a library that retrofits the print methods to canvas objects?

> (I 
> already indicated that in preceding responses in this thread but these 
> where never delivered; it seems I have a problem with the mail).

I think the mail problems where mostly caused by the mailing list move,
things should be stable now.

regards,
Chema





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