excalidraw / excalidraw-vscode

Excalidraw for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor
MIT License
456 stars 55 forks source link

Incorrect @font-face src in exported SVG file #100

Open onlyice opened 1 year ago

onlyice commented 1 year ago

When I export the diagram as an SVG file, I noticed that the font is not displayed as expected. Upon opening the SVG file, the following content can be found:

<defs>
  <style class="style-fonts">
    @font-face {
      font-family: "Virgil";
      src: url("https://file%2B.vscode-resource.vscode-cdn.net/Users/kevin.lin/.vscode/extensions/pomdtr.excalidraw-editor-3.5.1/public//dist/excalidraw-assets/Virgil.woff2");
    }
    @font-face {
      font-family: "Cascadia";
      src: url("https://file%2B.vscode-resource.vscode-cdn.net/Users/kevin.lin/.vscode/extensions/pomdtr.excalidraw-editor-3.5.1/public//dist/excalidraw-assets/Cascadia.woff2");
    }
  </style>
</defs>

The URL is not accessible, which cause the unexpected font rendering. I believe it's caused by commit 1b149a44115.

pomdtr commented 1 year ago

You're suspicion is right. Fixing this requires some change on excalidraw side, I'll contact the excalidraw team

HyunggyuJang commented 9 months ago

Any update?

mwopfner commented 8 months ago

I think it is till an open issue in excalidraw: https://github.com/excalidraw/excalidraw/issues/7543

karlhorky commented 14 hours ago

@pomdtr a new font picker has been published in https://github.com/excalidraw/excalidraw/pull/8012 (along with font embedding) - does that change anything for implementing in the Excalidraw VS Code extension?

pomdtr commented 14 hours ago

yeah it might be worth revisiting this issue :)