以编程方式将 SVG 形状转换为路径(lineto、moveto)

2024-02-11

我有一个来自 Inkscape、Illustrator 或任何其他应用程序的 SVG 文件。我想将形状转换为lineto, moveto, curveto format.

我想要的是这样的:

./Appname svgfile outfilewithpath

我将提供 SVG 文件作为参数,然后我的应用程序会将对象转换为相应的路径。


Inkscape 有一个命令行界面。使用Inkscape 手册页 http://inkscape.org/doc/inkscape-man.html随着动词来源 http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/verbs.cpp以供参考:

The ObjectToPath动词将对象转换为路径:

inkscape filename.svg --select=myobject --verb=ObjectToPath --export-plain-svg=filename_to_path.svg

The export-text-to-path参数将文本节点转换为路径:

inkscape filename.svg --export-eps=filename.eps --export-text-to-path

这些是有关如何从 Perl、Ruby、PHP 或 Python 运行 InkScape 的相关问题:

  • 使用 Perl 中的 Inkscape shell https://stackoverflow.com/questions/7695641/1113772
  • 在 PHP 中运行 inkscape https://stackoverflow.com/questions/3219507/1113772
  • 在 Python 中调用 Inkscape https://stackoverflow.com/questions/11651826/1113772
  • Inkscape 合并 Ruby Gem https://rubygems.org/gems/inkscape_merge/versions/0.1.3
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

以编程方式将 SVG 形状转换为路径(lineto、moveto) 的相关文章

随机推荐