From: Nikhil Ketkar
Subject: Looking for an SVG library
Date: 
Message-ID: <1122212951.003228.51010@f14g2000cwb.googlegroups.com>
I am looking for an SVG library. Something that allows me to generate
SVG code.
Basically something like this,
(rectangle 100 100 400 400 50 green)
should generate this,
 <rect x="100" y="100" width="400" height="200" rx="50"
        fill="green" />
It gets a lot complicated with grouping and animation tags.

Does one exist for lisp? I found one for perl and python but could not
fing one for lisp. There is some support for this in lush.
Would this be a useful thing to work on (If one does not exist)?

From: Mikko Heikelä
Subject: Re: Looking for an SVG library
Date: 
Message-ID: <Pine.OSF.4.61.0507242328550.4677@kosh.hut.fi>
On Sun, 24 Jul 2005, Nikhil Ketkar wrote:

> I am looking for an SVG library. Something that allows me to generate
> SVG code.
> Basically something like this,
> (rectangle 100 100 400 400 50 green)
> should generate this,
> <rect x="100" y="100" width="400" height="200" rx="50"
>        fill="green" />
> It gets a lot complicated with grouping and animation tags.

You could look at the various html-generating libraries.  For example 
cl-who by Edi Weitz does not care what sort of xml it is generating. 
If you really want to give the attributes as positional parameters, as 
per your example, you would have to write simple wrappers around 
library facilities.

HTH, -Mikko
From: MagicMuffinMan
Subject: Re: Looking for an SVG library
Date: 
Message-ID: <1124502427.273791.199830@o13g2000cwo.googlegroups.com>
Nikhil Ketkar schrieb:

> I am looking for an SVG library. Something that allows me to generate
> SVG code.
> Basically something like this,
> (rectangle 100 100 400 400 50 green)
> should generate this,
>  <rect x="100" y="100" width="400" height="200" rx="50"
>         fill="green" />
> It gets a lot complicated with grouping and animation tags.
>
> Does one exist for lisp? I found one for perl and python but could not
> fing one for lisp. There is some support for this in lush.
> Would this be a useful thing to work on (If one does not exist)?

I have the same problem, so I wrote some code to emit SVG. To generate
an SVG file you write something like

(with-svg-output (stream :width "10cm" :height "10cm" :viewbox "0 0 100
100")
  (rect :x 25 :y 25 :width 50 :height 50 :stroke "black" :stroke-width
"1px")
  (text (:x 50 :y 50 :style "text-anchor:middle")
    "Hello World!"))

You can get the code at http://kaikaminski.gmxhome.de/cl-svg.tar.gz.

Kai