On Wednesday 21 November 2001 19:53, Thierry Kormann wrote:

> > I've started to work through Doug Tidewell's O'Reilly-published book
> > about XSLT. On pages 32-33 there is an example of using XSLT to generate
> > SVG. I succesfully generated the SVG file with xalan:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"
> >     "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd";>
> > <svg height="4cm" width="8cm">
> > <g>
> >     <defs>
> >             <radialGradient fy="2cm" fx="4cm" r="3cm" cy="2cm" cx="4cm"
> > id="MyGradient"> <stop style="stop-color:red" offset="0%"/>
> >                     <stop style="stop-color:blue" offset="50%"/>
> >                     <stop style="stop-color:red" offset="100%"/>
> >             </radialGradient>
> >     </defs>
> >     <rect height="2cm" width="6cm" y="1cm" x="1cm"
> >             style="fill:url(#MyGradient); stroke:black"/>
> >     <text style="font-family:Verdana; font-size:24;
> >             font-weight:bold; fill:black" text-anchor="middle" y="2.2cm" x="4cm">
> > Hello, World!
> >     </text>
> > </g>
> > </svg>
> >
> > and then installed batik 1.1rc4 (using Sun JDK 1.3.1 under Linux) to
> > view it. I can't see a colo(u)r gradient. I've looked at the `Batik
> > status' page, but can't be sure whether 1.1rc4 should render the above
> > SVG file fully. (Not that it really matters; I'm just curious.)

Correction of some typos.

---

Batik does gradients.

The gradient you have defined is in 'objectBoundingBox' (the default value
of the 'gradientUnits' attribute). It means that all the attributes on
the radialGradient element is relative to the bounding box of the painted
element (your rect element in that case - so between 0 and 1 or 0% and
100%).

To fix your example, add gradientUnits='userSpaceOnUse' on the
radialGradient.

And may be, send a bug report to the author :)

Regards,
Thierry.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to