mb21/panwriter

Preview/export: support more fonts?

alexmyczko opened this issue · 6 comments

Thanks for PanWriter, but the font dialog is very limited, maybe add support for this?

https://github.com/alexmyczko/fnt

mb21 commented

Thanks for the feedback! This is definitely something I've been thinking about how to add best.

It would be easy to add all the fonts you've installed on your system to the dropdown and use those in the preview. But what happens if you export the document as HTML and somebody opens it that doesn't have that font installed? Should we include a webfont for that case? Google fonts?

It should be included as woff2, see woff2_compress, if license permits (it does for all fonts available by fnt). Definitely do not link to the internet for privacy reasons, see the links at fnt README.md.

I can test on Linux and macOS (having all system/user fonts in the list would already be a great improvement)

I would love to be able to add a new font as well. Adding the ability to insert the font as a <link> or @import would mean it is the responsibility of the user to ensure the font they add to the editor is also available in any generated document.

mb21 commented

You should be able to add custom CSS for the preview with @import or directly with @font-face commands (see the README.md), though I haven't tried it recently...

mb21 commented

Okay yes, let's keep this issue about the preview (and export), I've created #93 for the use-case with loading custom css into the editor.