Re: Canvas shortcomings



On Mon, 18 Jun 2001, Sander Vesik wrote:

> 
> On Mon, 18 Jun 2001, Mark wrote:
> 
> > 
> > On 17 Jun 2001, Peter Williams wrote:
> >  
> > > 
> > > I'm no expert, but as I said, my gut feeling is that it would take a
> > > long time to teach GTK+ to render in postscript.
> > >
> > 
> > You could probably make a wrapper to make the transition easier, so gtk+
> > does not sit directly on postscript but a layer above.
> > 
> 
> If you really want to do this, try to re-use existing things like say
> Xprint (yes, I know it is non-ideal). OTOH I am not really a fan of
> teaching the toolkit that level of things, and it would hopefully be
> optional.
> 

Optional? Such an API wouldn't be much different from gdk now. It would be
more like:

begin_paint
moveto ...
lineto ...
setlinewidth
bezierto ...

end_paint

Actually gnome-print implements an API like this, and this is also common
in other gui toolkits.

The main difference between pure Postscript and C, is that Postcript is a
postfix language similar to forth. It has and exceution stack, a graphics
state, and a dictionary. An equivelent C API can be made, but you loose
the beauty and compactness of Postscript.

This beauty of Poscript lies in how you can write small programs in which
you make new operators, and build more complex operaters based on the
simpler ones. Poscripts programs typically have a prolog in which common
operaters are defined. In a print setting these operaters can be reused on
every page, thus making the progam smaller and more elegant, and also
reducing the ammount of ram needed for the printer. In a display setting
you can define new operators which display a button or dialog box, or some
other graphic elements. These high level operaters can be sent directly to
the display server, instead of serializing each line in the drawing and
sending it to the display server. This not only reduces network traffic,
but it is a far more elegant solution, and alows for many more
optimizations in the server.

So hopefully you and others can see why postscript is so very beautiful,
and why I'm so stuburn about using it ;). Of course you can always
insulate someone from this beatuty by making a wrapper, and maybe some
times that would be benifitial.

At least hope you realize Postscript is a fully general 2D graphics
language. It apears most people here asociate Postscript with only
printers[1].

Mark

[1] For example the gnome wrapper for postscript is called gnome-print.
Also there is mention in this thread of wrapping postscript with other
graphics packages, when postscript is fully general to begin with and
there would be no gain in abstraction. 





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