This question may sounds dumb, but I can't manage to find a correct answer on my own. I am trying to use the SVG DOM interface in my python script. I would like to use getComputedTextLength but I can't find how even if I firstly thought it would be available thanks to modules or a packages like python-svg or something like that. I am sure there is something I miss, but I can't find what.
Any help would be appreciated. Thank you.
EDIT: I forgot to talk about what my script actually does. It's a Python script used to generate a SVG file from data grabbed on the Internet. My script needs to write texts and repeat them all along a path. Also, as I know the exact length (in pixels) of the path I need to know the length of the text in order to repeat it only what I need to. That's why a method like getComputedTextLength would be helpful.
To access the JavaScript DOM, we will be using a Python package called “JyServer.” You can simply install it with pip like this. Of course, you will also need Flask installed, which you can install like this.
In this article we will see how we can create SVG file using PyCairo in Python. SVG : An SVG file is a graphics file that uses a two-dimensional graphic vector format that defines images using an XML-based text format. As a standard format for showing vector graphics on the web, SVG files are developed.
Try this: http://www.gnu.org/software/pythonwebkit/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With