You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by ra...@audiofarm.de on 2003/08/29 14:52:34 UTC

@import

Batik's ImageTranscoder seems to ignore imported styles.

@import url("../default.css");

Is this not supported? The styles defined there are not visible AFAICS.

ralf ..

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


Re: @import

Posted by Ralf Siegel <ra...@audiofarm.de>.
>   Yes, this was fixed in CVS.  Sorry I mentioned it in the commit
>message but didn't follow up to your message.  The problem was that
>we were not applying styles associated with media 'all' which is
>the default media type for @import.  This is fixed.

Ah, cool. Thanks for the follow up.

ralf ...


-------------------------------------------------------------
Ralf Siegel - Freelance Developer
Recommended Listening: Broadcast - Haha Sound (Warp)
contact_site: mailto:ralf@audiofarm.de
-------------------------------------------------------------



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


Re: @import

Posted by Thomas DeWeese <Th...@Kodak.com>.
Ralf Siegel wrote:
> Hi Thomas,
> 
>> > Hi Ralf,
>> >
>> >      I believe it is.  Can you provide a reproducable test case?
>>
>> Yep, here we go:
> 
> 
> did you have time to look into the issue, or even more important: have 
> you been able to reproduce that behaviour?
> 
> TIA.

    Yes, this was fixed in CVS.  Sorry I mentioned it in the commit
message but didn't follow up to your message.  The problem was that
we were not applying styles associated with media 'all' which is
the default media type for @import.  This is fixed.



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


Re: Re: @import

Posted by Ralf Siegel <ra...@audiofarm.de>.
Hi Thomas,

> > Hi Ralf,
> >
> >      I believe it is.  Can you provide a reproducable test case?
>
>Yep, here we go:

did you have time to look into the issue, or even more important: have you 
been able to reproduce that behaviour?

TIA.

ralf ...


-------------------------------------------------------------
Ralf Siegel - Freelance Developer
Recommended Listening: Broadcast - Haha Sound (Warp)
contact_site: mailto:ralf@audiofarm.de
-------------------------------------------------------------



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


Re: Re: @import

Posted by ra...@audiofarm.de.
> > Batik's ImageTranscoder seems to ignore imported styles.
> > 
> > @import url("../default.css");
> > 
> > Is this not supported? The styles defined there are not visible AFAICS.
> 
> Hi Ralf,
> 
>      I believe it is.  Can you provide a reproducable test case?

Yep, here we go:

______________________________________________________________________

[ CSSImportDemo.svg ]
______________________________________________________________________



<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" 
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
	<!ENTITY ns_svg "http://www.w3.org/2000/svg">
	<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<!-- external CSS -->
<?xml-stylesheet type="text/css" href="styleB.css" ?>
<svg xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="310" height="540"
xml:space="preserve">
	<rect x="10" y="10" width="100" height="20" />
	<circle cx="50" cy="50" r="20" />
</svg>

______________________________________________________________________

[ styleA.css ]
______________________________________________________________________

circle  {
	fill:#0000FF;
}

______________________________________________________________________

[ styleB.css ]
______________________________________________________________________

@import url("styleA.css");

rect  {
	fill:#FF0000;
}

______________________________________________________________________

[ CSSImportDemo.java ] (taken from Batik's site)
______________________________________________________________________

import java.io.*;
import org.apache.batik.transcoder.image.JPEGTranscoder;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;

public class CSSImportDemo {

	public static void main(String[] args) throws Exception {
		
		// create a JPEG transcoder
		JPEGTranscoder t = new JPEGTranscoder();
		// set the transcoding hints
		t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(.8));
		// create the transcoder input
		String svgURI = new File("CSSImportDemo.svg").toURL().toString();
		TranscoderInput input = new TranscoderInput(svgURI);
		// create the transcoder output
		OutputStream ostream = new FileOutputStream("out.jpg");
		TranscoderOutput output = new TranscoderOutput(ostream);
		// save the image
		t.transcode(input, output);
		// flush and close the stream then exit
		ostream.flush();
		ostream.close();
		System.exit(0);
	}
}


______________________________________________________________________

The rect appears "red" as expected, whereas the circle should glow
"blue" - but it doesn't.

Thanks.

ralf ...

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


Re: @import

Posted by Thomas DeWeese <Th...@Kodak.com>.
ralf@audiofarm.de wrote:
> Batik's ImageTranscoder seems to ignore imported styles.
> 
> @import url("../default.css");
> 
> Is this not supported? The styles defined there are not visible AFAICS.

Hi Ralf,

     I believe it is.  Can you provide a reproducable test case?




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