Forum How do I...?

Support for vector-effect="non-scaling-stroke"

ckepper
I am trying to render a few SVG elements that make use of the vector-effect property in an SVG path and are then scaled via a transformation.

vector-effect="non-scaling-stroke"


Prince honors the original stroke-width but ignores the `vector-effect` attribute and scales the stroke together with the content. Here is the spec for non-scaling-stroke in the W3C SVG standard: https://www.w3.org/TR/SVG/painting.html#non-scaling-stroke
The attribute seems to be supported by most modern browsers: https://caniuse.com/vector-effect

You can find a test document attached to this message illustrating the problem. The request to render the document looks like this:

prince non_scaling_stroke.html -o non_scaling_stroke.pdf --page-size="924pt 666pt" --page-margin=0 --media print


Am I missing something here or should I rather implement a workaround?

Thanks for your support
  1. non_scaling_stroke.html0.8 kB
    sample document using vector-effect attr

Edited by ckepper

mikeday
Prince doesn't support the vector-effect attribute yet, we will need to investigate the practicality of supporting this.
ckepper
Thank you very much.