mb21 / panwriter

Markdown editor with pandoc integration and paginated preview.
https://PanWriter.com
GNU General Public License v3.0
1.03k stars 49 forks source link

Preview/export: support more fonts? #52

Open alexmyczko opened 3 years ago

alexmyczko commented 3 years ago

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

https://github.com/alexmyczko/fnt

mb21 commented 3 years ago

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?

alexmyczko commented 3 years ago

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)

shaneknysh commented 2 years ago

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 2 years ago

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...

shaneknysh commented 2 years ago

I am specifically looking to have the editor and the preview (and the export) all default to using Atkinson Hyperlegible and IBM Plex Mono for variable and fixed width fonts. Using the @import will do the trick for the preview and export but won't change the editor. I'd like to see the editor support any font installed locally and have the user responsible for adding the font to the preview or export.

edit: remove reply via email weirdness

mb21 commented 2 years ago

Okay yes, let's keep this issue about the preview (and export), I've created https://github.com/mb21/panwriter/issues/93 for the use-case with loading custom css into the editor.