[cairo] WG: parse svg with cairo

Kreller, Marcus MKreller at ime-actia.de
Fri Jun 8 00:44:02 PDT 2007


Thanks for your answer,

i still use rsvg to render SVG files. But i have some trouble with rsvg, not all SVG files where accepted by rsvg_handle_render_cairo(). 

Here two different SVG Files:

1) Accept 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
<svg
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   version="1.0"
   x="0"
   y="0"
   width="214.100006"
   height="168.612503"
   viewBox="0 0 254 192"
   id="svg602"
.
.
.


2) Doesn´t Accept

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"
	"http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd"
>
<svg width="539.963pt" height="803.211pt" viewBox="0 0 1108.81 803.211" xml:space="preserve" preserveAspectRatio="xMinYMid meet" xmlns="http://www.w3.org/2000/svg" xmlns:daisy="http://www.daimlerchrysler.com" contentStyleType="text/css" contentScriptType="text/ecmascript" zoomAndPan="magnify">
<metadata>
<daisy:ordnungstitel daisy:ordnungstitelid=""/>
<daisy:gueltigkeit daisy:gueltigkeitid=""/>
<daisy:produktgliederung/>
<daisy:beschreibung/>
</metadata>
<daisy:elementgroups/>
<text stroke="none" fill="#000000" font-size="15.54" text-anchor="middle" x="95.9" y="659.8" id="_00010" daisy:hotspot="MAPPING" daisy:reference="A1e17" daisy:framecoord="2K">A1e17</text>
<text stroke="none" fill="#000000" font-size="15.54" x="256.1" y="629.1" id="_00020" daisy:hotspot="MAPPING" daisy:reference="A1" daisy:framecoord="4J">A1</text>
<text stroke="none" fill="#000000" font-size="15.54" x="215.7" y="103.9" id="_00030" daisy:hotspot="MAPPING" daisy:reference="L6/2" daisy:framecoord="3B">L6/2</text>
<text stroke="none" fill="#000000" font-size="15.54" x="242.3" y="249.5" id="_00040" daisy:hotspot="MAPPING" daisy:reference="N30/4" daisy:framecoord="4D">N30/4</text>
<text stroke="none" fill="#000000" font-size="15.54" x="330.8" y="353.2" id="_00050" daisy:hotspot="MAPPING" daisy:reference="A7/3" daisy:framecoord="5E">A7/3</text>



Can anyone help me? 
rsvg_handle_render_cairo() broken up without a message.

Thanks



-----Ursprüngliche Nachricht-----
Von: MenTaLguY [mailto:mental at rydia.net] 
Gesendet: Donnerstag, 7. Juni 2007 16:41
An: Kreller, Marcus
Cc: cairo at cairographics.org
Betreff: Re: [cairo] parse svg with cairo


On Thu, 7 Jun 2007 13:13:06 +0200, "Kreller, Marcus" <MKreller at ime-actia.de> wrote:
> Is there a way to open svg-files with cario 1.0.4, without rsvg handle ? 

No -- cairo is just a drawing library, not an SVG renderer.  At one time, cairo included a primitive SVG renderer for the sake of demonstration, but that is not part of the library's core goals.

You'll need to use another library built atop cairo (like rsvg) to render SVGs to a cairo context.

-mental




More information about the cairo mailing list