[Qgis-developer] Re: SVG handling in qgis

John C. Tull john.tull at wildnevada.org
Mon Nov 23 12:39:20 EST 2009


Hi Andreas,

On Nov 22, 2009, at 4:56 AM, Andreas Neumann wrote:

> Hi John,
> 
> Can you be more specific on what "garbled" means? Does it mean that text elements are broken? Or other elements as well? Can you provide an example?

Garbled, meaning text elements being overlayed with black boxes, text not wrapping. Also, a couple of complex svg's traced from raster images were showing lines shooting off to the side, misplaced, etc. Before I send a sample, I will try the suggestions below.

> Yes, there are a few problems with proper SVG support in QGIS. Here is a summary:
> 
> * Import in print composer or symbols:
>  - qt only supports the limited SVG tiny format (http://www.w3.org/TR/SVGMobile12/). This means as an example that text elements do not support <tspan/> childs with a delta y.

Yes, I think this is the source of my problems, hence the interest in an open source means of SVG tiny creation.

> * Export from print composer:
>  - No clipping/masking of map-data to the map boundaries. Workaround: after import in Inkscape, Illustrator or Corel, add a rectangle and change it into a rectangular mask and apply them to map group
>  - Symbols are exported as raster instead of vector
>  - structure of export SVG could be improved and id's could be added to better understand the document tree of the output
>  - some unnecessary elements are exported.ex

This is good information to know.

> What I can recommend is:
> - use the newest Inkscape version (0.47) and avoid multiline text

Yes, this is definitely a source of some of the problems I have seen.

> - save as "Optimized SVG" and not "Inkscape SVG" to keep the filesize smaller. Optimized SVG means that the output runs through SVG scour
> - in the Inkscape preferences -> SVG output enable the checkbox "inline attributes"
> - optionally run the output manually through SVG scour (a python commandline script) for additional manual optimization (http://www.codedread.com/scour/)
> 
> Inkscape 0.47 contains Scour, but offers only limited commandline switches, not complete control over scour as you can get with the commandline version of scour.

More good suggestions.

> Meanwhile I will see if I can extend scour to solve the issue of multiline text with tspans. I can't promise when, though ...
> 
> Hope this helps,
> Andreas

This information and your suggestions will help. Thanks for your detailed reply.

Cheers,
John

> John C. Tull wrote:
>> Hi Andreas,
>> 
>> Tim said you were the resident svg guru. I have been running into problems with svg images I have created in Inkscape coming through garbled when rendered in qgis. Tim mentioned a minisvg spec, but I cannot find anything on that from a google search.
>> 
>> Is there a means to output svg files from Inkscape or some other for of conversion to make svg files meet the requirements of qgis?
>> 
>> Thanks,
>> John
> 



More information about the Qgis-developer mailing list