Skip to content

PDF export issue with SVG with symbols #9058

Open

Description

@trama

Description

Hi everyone,
I was able to reproduce an issue when we try to export to PDF (typst compile) a typst file which embeds SVG figures containing symbols.

Example: Create an electric circuit with tools like TikZ (like the online circuitikz) and export to SVG. These files can be embedded in typst and the preview and SVG exporrt is correct. When you compile them to PDF there are rendering issues.

In my example, empty circles (only a black outer stroke, with white fill) are rendered in PDF like filled black circles.

You can find here two SVG images, i.e. wheat.svg and wheat1.svg. The only difference between the two is that the second has symbols, while the first has been manually converted by me in normal paths (no more symbols used).

A simple test file to repreoduce the issue can be this:

#set page("a4")

The *Wheatstone bridge* is [].

#figure[
  #image("wheat.svg", height: 7cm)
]

#figure[
  #image("wheat1.svg", height: 7cm)
]

Converting SVG images to PDF solves the issue, but it is a workaround, not an expected Typst feature, I suppose ;)

Thank you to everyone, more competent than me, that could investigate this issue.

Bye
Federico

wheat wheat1

Operating system

macOS

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Nov 11, 2026
  2. flokl commented on Nov 11, 2026

    @flokl

    It seems like the fill="currentFill" is the problem! I looked into the SVG2 spec but didn't find currentFill. There is currentColor as a keyword, maybe it got mixed up with that or with context-fill.

  3. added
    pdf
    svg
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpdfsvg

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions