xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dylan Browne" <dbro...@mango-solutions.com>
Subject RE: Using CSS in Batik
Date Wed, 14 Dec 2005 07:09:28 GMT
Hi, thanks for the reply. 

Sorry, I wasn't specific enough in my question. I am familiar with using CSS
in SVG, but I have recently begun using the Apache Batik SVG java libraries,
using the SVG DOM, to create SVG dynamically from java.

Currently I am using code like this to style my Elements:

text.setAttributeNS(null, "style",
"fill:green;font-family:sans-serif;font-size:18pt;text-anchor:middle");

And what I would like to be able to do instead is import my stylesheet into
the SVG DOC that I generate through Java.

I can see there is a style sheet class, but no examples on how to use it.
That's really what I was after.

Any further advice very gratefully received.

Thanks in advance again,
Dylan

-----Original Message-----
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Sent: 14 December 2005 01:23
To: batik-users@xmlgraphics.apache.org
Subject: Re: Using CSS in Batik

Hi Dylan,

"Dylan Browne" <dbrowne@mango-solutions.com> wrote on 12/13/2005 11:59:01 
AM:

> Im trying to import a CSS file into Batik in order to remove hard-wired 
styles
> from my code. I checked out the Javadocs which helped slightly but 
haven't 
> managed to get anything working. Ive Googled and searched the archives, 
and 
> can not find any examples or sample code.

   You might try looking at the SVG specification.  You use the
'style' element to reference CSS style sheets.  You might also take
a look at samples/tests/spec/styling in general and 
'alternateStylesheet.svg' in particular.

> If anyone has a code snippet that shows how to import the CSS file, and 
> reference a style class within it I'd be very grateful

   You don't reference a style class with in the selector selects
elements from your document that they apply to based on the selector
associated with the style.



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message