Questions tagged [svgwrite]

svgwrite is an extension to the Python programming language which provides support for creating SVG drawings.

Official Resources

42 questions
0
votes
1 answer

Svgwrite only works in IDLE

Inexperienced in programming. Svgwrite scripts only work in IDLE for me. Let's say you have this: import svgwrite svg_document = svgwrite.Drawing(filename = 'new.svg', size = (2400, 2400)) print(svg_document.tostring()) svg_document.save() What…
0
votes
1 answer

How to insert image into a circle element of svg? (Python: svgwrite)

I know how to do this task on a normal SVG file but I'm using svgwrite package in python 3.7 and I don't know how to do this. Sadly website documentation doesn't cover this topic accurately enough... Here is the code I came up with and it won't…
Hasan Parasteh
  • 431
  • 8
  • 25
0
votes
0 answers

How can I programmatically resize SVG file with svgwrite in python?

My current workflow is using svgwrite to generate my svg file and import into inkscape to resize and align to export to gcode. I'm looking for a way to do this programmatically via cli. I've tried a couple svg-resizing repo's from github however…
TehPirate
  • 154
  • 1
  • 12
0
votes
1 answer

Unexplained behavior when saving SVG file using svgwrite

Background: I have been working on a image creator wrapper that allows creating images using raster (OpenCV/numpy/PIL) & vector graphics (svgwrite). The problem is when creating vector images using svgwrite. Problem: The image creation process…
banerjk
  • 335
  • 2
  • 15
0
votes
1 answer

Python svgwrite and simultaneous animationTransforms

I am trying to use python svgwrite to make an object scale and rotate at the same time. My efforts has so far been to add two consecutive "animateTransform". It does however seem to only take the last action into account, as seen in my…
Emil
  • 11
  • 1
0
votes
1 answer

Adding text into groups does not work for svgwrite

I'm writing some basic script to create basic charts using python's svgwrite. I have successfully been able to create groups with other items, such as circles, paths and lines. However when adding several text elements into a group those are not…
0
votes
1 answer

Get width of a group element using python svgwrite library

I am using python library svgwrite to generate svg file. I have to put two lines of text exactly at the center of a rectangle. The texts should be left aligned. The width and height of the rectangle is known. I inserted two text lines inside a group…
0
votes
1 answer

SVG, forming lines into an image

I'm forming an image in SVG from a bitmap using svgwrite and python where each line is rotated by theta around a common origin into a fan like-pattern. Currently this image is running around 10 MB for 128 lines largely because the excessive amount…
Cameron Lowell Palmer
  • 21,528
  • 7
  • 125
  • 126
0
votes
2 answers

How to Invert SVG text with appropriate kerning?

How can I invert (rotate 180 degrees) a text object so that the text is kerned appropriately? My example uses Python and the svgwrite package, but my question seems about any SVG. Suppose I use the following code: dwg =…
rikb
  • 630
  • 5
  • 18
0
votes
1 answer

Converting SVG lines to arcs

I'm using Python's svgwrite to draw an SVG diagram. I have a bunch of horizontal lines that I'm currently drawing with Paths. It's pretty simple, point A to point B. I'd like to convert these lines to be slightly rounded up (the height will be…
Brandon
  • 668
  • 8
  • 22
-1
votes
1 answer

How to center text along a path with svgwrite

I have a path I've created in svgwrite and I want to have my text to be centered along that path. It's confusing since the svgwrite API doesn't appear to offer any mechanism for doing so
Zain Rizvi
  • 23,586
  • 22
  • 91
  • 133
-1
votes
1 answer

How to (re)define function with complex argument

I use the svgwrite library in Python and, because svg has y-axis going downwards while I find it more convenient to have it upwards, I defined a function YInvert which does the trick for me. However, I have to use this function every time I use a…
fales
  • 89
  • 7
1 2
3