English 中文(简体)
How to simplify SVG code?
原标题:
  • 时间:2009-12-01 08:06:05
  •  标签:
  • svg
  • javafx

Is it possible to simplify / clean up svg code by replacing the use-tags with standard svg elements? Maybe an inkscape plugin? Haven t found anything...

Background: I m converting some svgs to javafx graphics (.fxz) with javafx s production suite. And the tool doesn t understand the <use> element.

问题回答

Take a look at Scour - an SVG scrubber

Scour is an open-source Python script that aggressively cleans SVG files, removing a lot of cruft that certain tools or authors embed into their documents. The goal of scour is to provide an identically rendered image (i.e. a scoured document should have no discernable visible differences from the original file).

They also have an extension for Inkscape as of v.48. To use it, go to "Save As.." and choose "Optimized .SVG. Be careful, and check your output, as I ve found it can get too aggressive. Take these examples for instance, if they show up...

Good: Original SVG, only slightly mucked with.. Bad: After a harsh "Scouring"

They claim to have and an online tool that does the same tricks... but as of 6/2011 it was not working. Hope this helps you clean up those often SCARY looking SVG s. Sometimes I feel like I m the only one that realizes what this format is capable of!





相关问题
How to simplify SVG code?

Is it possible to simplify / clean up svg code by replacing the use-tags with standard svg elements? Maybe an inkscape plugin? Haven t found anything... Background: I m converting some svgs to javafx ...

How to link from SVG?

What I tried is this <a xlink:target="http://ponyoverflow.com"> <text class="text" x="20" y="718" text-anchor="start">Mail Order Ponies</text> </a> and variations with href ...

Ruby Support for SVG

Is there some library or helper to produce SVG graphics with Ruby? I googled a bit and found many, but all seem to be dusty and very incomplete… Does anyone know about some nice, reliable alternative?

Mangling IDs and References to IDs in XML

I m trying to compose xml elements into each other, and the problem I am having is when there s the same IDs. Basically what I need to do is mangle all the IDs in an xml file, as well as the ...

热门标签