从SVG文件创建cairo路径 [英] Create cairo path from SVG file
问题描述
一定是我想念的东西.
我在Windows上,并且希望使用python从SVG文件中获取路径,将它们中的每一个缩放到一个新的表面上(或完全在一个表面上,这并不重要).
I am on Windows and want to use python to take the paths from a SVG-file, scale them an place every single one of them on a new surface (or all on one, that doesn't really matter).
我在此处和
I read about cairo here and on stackoverflow and it seemed to me, that it would fit my needs, but I could not find an easy way to generate a path from a svg file. Is there no easier solution than parsing the SVG by hand eg. with xml?
推荐答案
CairoSVG解析SVG文件并将其呈现给cairo: http://cairosvg.org/
CairoSVG parses SVG files and renders them to cairo: http://cairosvg.org/
如果只需要一条路径,则应该可以使用CairoSVG的正确功能.随时在跟踪器上提问
If you only want a single path, it should be possible to use just the right functions from CairoSVG. Feel free to ask on the tracker
这篇关于从SVG文件创建cairo路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!