question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option in export to convert text to outlines in SVG

See original GitHub issue

It would be a nice feature if you can export text as outlines inside an SVG.

Example:

Screenshot 2020-07-27 at 18 15 13

Right now text exports as real text by default:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 65 45">
  <!-- svg-source:excalidraw -->
  <defs>
    <style>
      @font-face {
        font-family: "Virgil";
        src: url("https://excalidraw.com/FG_Virgil.woff2");
      }
      @font-face {
        font-family: "Cascadia";
        src: url("https://excalidraw.com/Cascadia.woff2");
      }
    </style>
  </defs>
  <g transform="translate(10 10) rotate(0 22.5 12.5)">
    <text x="0" y="18" font-family="Virgil" font-size="20px" fill="#000000" text-anchor="start" style="white-space: pre;" direction="ltr">Test</text>
  </g>
</svg>

But that only works if you want to display a real font. It fails if:

  1. for some reason a viewer can not fetch an external font (e.g. due to security policies), or
  2. software can’t display external fonts. Like the default macOS finder:

Screenshot 2020-07-27 at 18 13 32

When a user would be able to choose to convert text to outlines (like in a vector program) this could be used to overcome this problem.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:12
  • Comments:23 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
dwellecommented, Oct 1, 2020

@vjeux weird, but looking at the source, those two svg paths for the shape are not identical. Seems like the post is optimized SVG while the pre isn’t. The inlined font itself is definitely ~15kb large, though, if you count it manually.

1reaction
dwellecommented, Jul 30, 2020

Text consisting of more than ~600 characters in total. Our font has 534 glyphs, according to https://fontdrop.info/, but some characters are more complex than others so if you stick to just latin chars, the tipping point will probably be above those 534, maybe even closer to 700. Dunno, we’d have to test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SVG option to convert text to outlines when exporting
You may find the option in the Font dropdown menu. Select Convert To Outlines in the SVG Export dialog. The text in your...
Read more >
Automatically convert text to outlines on export? - Sketch Talk
When exporting an SVG that has text, is it possible (natively or with a plugin) to automatically convert the text to outlines?
Read more >
Add SVG export option: outline strokes - Share an idea
I'm currently working on a set of icons which are a mix of bought and customised vectors. The bought icons are all shapes...
Read more >
Converting Text to Outlines The Right Way
For each spread that contains text that you want converted to outlines, put a transparency object on it. If you want to convert...
Read more >
How to Outline a Font - Convert Font To SVG Online - Vector Ink
Step 1. Add text to the canvas. Tap on the Text icon located at the bottom of the toolbar. · Step 2. Choose...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found