
Convert text to an SVG path
Set a line of text in a font and get back one SVG with a single `<path>` element, the outlines, not a `<text>` tag, so it renders identically everywhere without the font installed.
Convert text to an SVG path renders one line of typed text in a chosen font and returns one SVG built from a single traced path, not a text tag. Font size runs 8 to 500 pixels, 48 by default, with the margin scaling to match. Characters the font cannot render are dropped before the text is set.
Questions
Why is the output a path element instead of a text element?
So the SVG renders identically everywhere without the font being installed on the viewing device; the text is converted into its actual outline shapes at build time using the font's own bezier curves, rather than referencing a font by name.
What is the allowed range for the size option?
8 to 500 pixels, defaulting to 48; anything outside that range is refused with a message quoting exactly what you gave.
What happens to characters my font does not have?
They are silently dropped from the text before it is set, except for the space character, which is always kept even if the font has no explicit space glyph; if every character ends up dropped, the run fails on zero rendered width.
What if the text option is left empty?
It refuses with a message naming the file, saying text is empty and to set it to the line you want as an SVG path.
How is the margin around the text decided?
It scales with the chosen font size: the margin is 10 percent of the size, or 2 pixels, whichever is larger, applied on all four sides of the resulting SVG.
Compare
| Tool | Runs on the CLI | Live as you type |
|---|---|---|
| Convert text to an SVG path | Yes | No |
| Convert a font to OTF | Yes | No |
| Subset a font to specific characters | Yes | No |
| Render a font specimen sheet | Yes | No |
| Export font glyphs as SVG | Yes | No |
| Embed a font as a CSS data URI | Yes | No |
| Turn an icon font into an SVG sprite | Yes | No |