Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for pathLength? #879

Open
prompteus opened this issue Jan 27, 2025 · 1 comment
Open

Support for pathLength? #879

prompteus opened this issue Jan 27, 2025 · 1 comment

Comments

@prompteus
Copy link

Hi,
resvg ignores pathLength attribute (SVG specification).

<svg height='1000' width='1000' xmlns='http://www.w3.org/2000/svg'>
    <path
        d='M 100 100 L 900 100 L 900 900 L 100 900 Z'
        stroke='black'
        stroke-width='10'
        stroke-dasharray='100 100'
        fill='blue'
        pathLength='1000'
    />
</svg>

Setting pathLength='1000' vs pathLength='10000' should affect the rendered length of the dashes (and gaps) of the stroke. This is specified by SVG 1.1 standard (SVG 2 extends the attribute to rect, circle, etc.)

For reference, I tested the example in a few programs. Here is if they support the pathLength attribute correctly:

✅ Chrome (version 130.0.6723.117 arm64)
✅ Firefox (version 134.0.2, aarch64)
✅ Safari (version 17.4.1)
❌ Inkscape (Inkscape 1.3.2)

@RazrFalcon
Copy link
Collaborator

Yes, pathLength isn't supported and for some reason is missing from our unsupported.md docs...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants