Skip to content

Support nested SVG text spans #30

Description

@rowland

Problem

The current parser warns svg: <text>: nested text elements are unsupported and were skipped. This means SVGs using <tspan> or more structured text runs lose portions of their text.

What implementation would require

  • Extend text parsing to preserve nested text nodes instead of flattening only direct character data.
  • Add support for <tspan> as the first practical target, including inherited style, per-span x/y/dx/dy, and anchor behavior.
  • Decide the minimum text layout subset we need now versus full SVG text semantics.
  • Make renderer state changes safe across nested spans so fill/font changes do not leak.
  • Add tests for multi-span text, partial style changes, and positioned tspans.

Workarounds

  • Convert text to outlines for logo/branding assets.
  • Export SVGs with simpler single-node text when text remains editable.
  • Use plain <text> without nested spans in PDF-targeted assets.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions