svg - 如何简化SVG代码?

标签 svg javafx

是否可以通过用标准 svg 元素替换使用标签来简化/清理 svg 代码?也许是一个inkscape插件?什么都没找到...

背景:我正在使用 javafx 的生产套件将一些 svgs 转换为 javafx 图形 (.fxz)。并且该工具不理解 <use>元素。

最佳答案

看看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).



他们还有一个 extension for Inkscape从第 48 版开始。要使用它,请转到“另存为..”并选择“优化的 .SVG。小心,并检查您的输出,因为我发现它也可以得到 侵略性。以这些例子为例,如果他们出现...

好:Original SVG, only slightly mucked with..坏:After a harsh "Scouring"

他们声称拥有和 online tool这样做的技巧相同……但截至 2011 年 6 月,它不起作用。希望这可以帮助您清理那些经常看起来很吓人的 SVG。有时我觉得我是唯一一个意识到这种格式的能力的人!

关于svg - 如何简化SVG代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1824677/

相关文章:

c# - 如何在 Canvas 中同时缩放和平移多个对象 - Windows Phone 8

python - savefig 未保存树状图轴

svg - 如何将 D3 selectAll 与多个类名一起使用

html - 使用 CSS 对字体进行圆 Angular 处理

java - 如何在 Swing 应用程序中运行 Javafx 舞台/场景?

svg - 如何从旋转/平移/缩放值计算 SVG 变换矩阵?

java - 使用 OpenViewerFX 显示某些 PDF 时出错

exception - JavaFX 禁用 TreeView 折叠

java - 如何从 JavaFX webviewer 中的一串 html 代码加载网页?

javafx - 如何使节点在 Pane 中居中javafx