svgwrite
svgwrite copied to clipboard
Is vector-effect="non-scaling-stroke" supported?
I'd like to add the vector-effect="non-scaling-stroke" property to an object. Is this supported?
It's not supported via the API surface, but you can set vector-effect via a style sheet. You'll need to add a style to your drawing, which defines a class in it that has the property, and then set that class on the desired object.
Basically:
dwg.defs.add(dwg.style("""
.vectorEffectClass {
vector-effect: non-scaling-stroke;
}
"""))
dwg.add(dwg.path(d="M 0 0 L 1 1", class_='vectorEffectClass'))