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

Wrong SVG line thickness in PDF Export #1063

Closed
1 task done
johannes-wolf opened this issue May 1, 2023 · 3 comments
Closed
1 task done

Wrong SVG line thickness in PDF Export #1063

johannes-wolf opened this issue May 1, 2023 · 3 comments
Labels
bug Something isn't working svg Anything about the file format for people who like to have fun.

Comments

@johannes-wolf
Copy link
Contributor

johannes-wolf commented May 1, 2023

Description

When using SVG (created via Inkscape) lines are rendered super heavy in PDF output. Rastered rendering of the Web-App looks fine.

SVG:
op-25-1-inversion

PDF Rendering:
grafik

Web-App Rendering:
grafik

Hand editing the SVG and lowering all stroke-width attributes works as a workaround.

Reproduction URL

https://typst.app/project/r3WnZVT7F94NiikElL2ylN

Operating system

Web app, Windows, Linux, macOS

Typst version

  • I am using the latest version of Typst
@johannes-wolf johannes-wolf added the bug Something isn't working label May 1, 2023
@laurmaedje laurmaedje added the svg Anything about the file format for people who like to have fun. label May 8, 2023
@laurmaedje laurmaedje changed the title In PDF Export SVG Lines are Rendered very Heavy Wrong SVG line thickness in PDF Export May 15, 2023
@LaurenzV
Copy link
Sponsor Collaborator

Minimally reproducible example:

<svg width="100" height="30" version="1.1" xmlns="http://www.w3.org/2000/svg">
    <rect width="100" height="100" fill="white"></rect>
    <g transform="scale(.1 .1)">
        <line x1="0" x2="100" y1="150" y2="150" stroke="#000" stroke-width="5"/>
    </g>
</svg>

What it should look like:
image

What it actually looks like:
image

Looks to me like the stroke-width property is not affected by the scale, even though it should.

@LaurenzV
Copy link
Sponsor Collaborator

Once this PR gets merged, this issue should be fixed.

@laurmaedje
Copy link
Member

Fixed thanks to typst/svg2pdf#30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working svg Anything about the file format for people who like to have fun.
Projects
None yet
Development

No branches or pull requests

3 participants