excalidraw / excalidraw-vscode

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

Configure the customized font in extension #48

Closed Anddd7 closed 2 years ago

Anddd7 commented 2 years ago

Is there any easy way to replace default fonts? or add a new one by extension configuration. like https://github.com/zsviczian/obsidian-excalidraw-plugin?

(I'm willing to raise PR if you can provide some guidance 😄

pomdtr commented 2 years ago

Thanks for raising the issue in the upstream repository !

The vscode extension is just a wrapper around the npm package, so we should update the api before implementing the feature in the extension.

pomdtr commented 2 years ago

I did take a look at how @zviczian obsidian implemented it, but it looks like it breaks compatibility with excalidraw.com.

Anddd7 commented 2 years ago

Thanks for reply.

Yes, is it possible to provide a fourth font which can be configured or overwritten via env, param or dropdown?

pomdtr commented 2 years ago

The best thing without too much tweaking would be to allow the customization of the EXCALIDRAW_ASSET_PATH value: https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README_NEXT.md#installation

You should then be able to customize the font used for the Virgil, Helvetica and Cascadia fonts by hosting your own asset folder.

Anddd7 commented 2 years ago

I see, i can repleace the font file and rebuild a customized plugin as well.

Thanks for your sugguestion, I'll close this issue.