svg2pdf icon indicating copy to clipboard operation
svg2pdf copied to clipboard

Converting the Rust logo doesn't work

Open msrd0 opened this issue 2 years ago • 1 comments

I tried converting the Rust logo (https://upload.wikimedia.org/wikipedia/commons/d/d5/Rust_programming_language_black_logo.svg) using this tool but it looks a little off:

image

msrd0 avatar Aug 17 '22 16:08 msrd0

huh, shit

It does not seem to like the transformation of the R's path. This is related to #9. I'll look into it but unfortunately do not have a lot of bandwidth right now :(

reknih avatar Aug 17 '22 19:08 reknih

I tried debugging this, and I think the reason is that similarly to #9, the transformation of a group doesn't seem to apply to masks. Here is a minimal example that reproduces this:

<svg version="1.1" height="200" width="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <g transform="translate(50, 50)">
        <g mask="url(#rect)">
            <rect width="100" height="100" fill="green" />
        </g>
        <mask id="rect" >
            <rect width="30" height="30" fill="white"/>
        </mask>
    </g>
</svg>

I tried finding the issue in the code and I suspect that something is wrong in the apply_mask method, but unfortunately I don't really understand what is going on there with the calculations, so I haven't been able to fix this.

LaurenzV avatar Dec 30 '22 19:12 LaurenzV

I'm sorry about having closed the issue, the text in PR #19 triggered the auto-close.

reknih avatar Dec 31 '22 10:12 reknih