Skip to content

Render actual text rather than paths in SVG (possibly with embedded fonts) #4702

@ongun-kanat

Description

@ongun-kanat

Description

While rendering text and fonts as paths in SVG images guarantee a consistent output, it makes them unselectable and unsearchable. The rendered path is also limited by the capability of the rendering engine and the font libraries Typst uses which are currently not as complete as the text rendering infrastructure that come with the OS and browsers.

An option in the typst CLI to opt for SVG <text> element output for the textual data would be very useful, especially when the file is to be viewed in the browser.

An optional improvement over this is embedding the actual fonts within the SVG file. This has a potential to bloat the SVG file, but could be useful for things like figures.

Use Case

I'm using Typst to generate figures containing shapes and tables. I would prefer the text in them to be selectable when viewed in a browser.

SVG files that use <text> elements are also smaller than the SVG files whose text is converted into paths.

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