Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Self hosted" excalidraw exports SVG with non standard path #7543

Open
bric3 opened this issue Jan 11, 2024 · 3 comments
Open

"Self hosted" excalidraw exports SVG with non standard path #7543

bric3 opened this issue Jan 11, 2024 · 3 comments

Comments

@bric3
Copy link

bric3 commented Jan 11, 2024

Hi, I'm the developer of the IntelliJ plugin that integrates Excalidraw.

I recently upgraded excalidraw, I noticed that SVG files have now the "wrong" URL for some assets like the fonts.

  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 437.9033836762792 296" width="875.8067673525584" height="592">
    ...
    <defs>
      <style class="style-fonts">
        @font-face {
          font-family: "Virgil";
-         src: url("https://excalidraw.com/Virgil.woff2");
+         src: url("https://excalidraw-jetbrains-plugin//dist/excalidraw-assets/Virgil.woff2");
        }
        @font-face {
          font-family: "Cascadia";
-         src: url("https://excalidraw.com/Cascadia.woff2");
+         src: url("https://excalidraw-jetbrains-plugin//dist/excalidraw-assets/Cascadia.woff2");
        }
      </style>
      
    </defs>
    ...
  </svg>

It appears this is related to this change.

I am actually interested by the opposite. In order to interface the webapp with IntelliJ (and to work offline), Excalidraw is self hosted in the IJ process.

However I would like the SVG files to keep the standard assets path, i.e. the one that goes to excalidraw.com. I looked at the change and I'm not sure it is possible to work around it.

I do understand the original issue, but maybe there should be an option to use the standard paths ?

@mwopfner
Copy link

mwopfner commented Jan 17, 2024

It would be great to have a way to define an own url for the fonts when a svg file is exported.
Even better would be to add this url as the first one and then fallback to excalidraw.com.

src: url("https://my-url/Cascadia.woff2"),  url("https://excalidraw.com/Cascadia.woff2");

This would allow to support both use cases at once. You first try to use the local font and if it is not available use the on hosted in the internet.

bric3 added a commit to bric3/excalidraw-jetbrains-plugin that referenced this issue Jan 27, 2024
bric3 added a commit to bric3/excalidraw-jetbrains-plugin that referenced this issue Jan 27, 2024
@bric3
Copy link
Author

bric3 commented Jan 27, 2024

For now I'm working around this by patching the SVG string myself. But this is less than optimal.

@chowey
Copy link

chowey commented Mar 5, 2024

Even better might be to also allow a locally-installed font:

src: url("https://my-url/Cascadia.woff2"),  local("Cascadia"), url("https://excalidraw.com/Cascadia.woff2");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants