Skip to content

SVG Export size reductions #6359

@bluss

Description

@bluss

Description

Hi, I recently ran scour to reduce size of these typst outputs (to save space in typst/packages). The following are ideas for reducing size of SVG outputs:

  • Use unique minimal ids
    • Typst 0.13.1 produces symbols with ids like id="gAE8F30B35D6A8EB54F09046949FB529D"and scour replaces it with id="n" and so on
    • This saved 8% file size on the two text filled tables
    • Unclear if viable for Typst
  • Use less indentation
    • Typst 0.13.1 produces 4-space indentation, consider 0-space, 1-space or no whitespace at all
    • Going from 4-space to no whitespace saves 5-10% on the tested files.
  • Use less coordinate precision
    • This is a lossy thing that scour does. It's probably not a good fit for Typst (?)

Use Case

It would save some space and bandwidth

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or requestsvgAnything about the file format for people who like to have fun.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions