[cairo] shape api

Liam Breck svg at networkimprov.net
Wed Jun 15 15:40:13 PDT 2005

At 09:43 AM 6/15/05 -0700, Carl Worth wrote:
>> It would be really useful if cairo had a lightweight toolkit for common
>> shapes and figures. It looks like a variety of such things are already
>> implemented in svg_cairo.c ...
>I don't see that much in svg_cairo.c. I looked for shapes it has that
>aren't directly supported by cairo and I only recall finding the
>following three shapes:
>	quadratic curves
>	rounded rectangles
>	arcs specified by bounding rectangle (rather than center+radius)

I would include some utilities from svg_cairo as well as shapes, e.g.
render_image and length_to_pixel. These and other things really belong in
some middle layer where other apps can use them, without having to maintain

>But if it were implemented as a linkable library, I think in
>the end you'd have a huge library...
>Maybe it would be better to make the "shape library" be a collection
>of code snippets that could easily be pasted into applications?

I think you'd make it a shared lib included in cairo releases.
Alternatively, users could recompile a static library after setting
switches for the components they need. The arc_to code isn't small enough
to meet my definition of "pastable" :-)

My proposal is to start this lib and see how it evolves. If I created a
first version by yanking stuff from svg_cairo, would you add it to the cvs,
and would you rev svg_cairo to use it?


More information about the cairo mailing list