samsa icon indicating copy to clipboard operation
samsa copied to clipboard

Ability to load Google font and upload custom fonts

Open crypto-dump opened this issue 5 years ago • 6 comments

It would be great if we can load google fonts or upload custom fonts to Samsa.

crypto-dump avatar Mar 11 '21 21:03 crypto-dump

Do you mean upload your own fonts so that they stay in the list? There is no actual “uploading” in Samsa; drag-drop parses the font file in memory.

The way you get Samsa’s menu to show a custom set of fonts is to install Samsa locally, and edit samsa-config.js to point to (or base64-embed) your fonts.

Regarding Google fonts, I could write a script to add their latest VFs. I don’t want to overwhelm the menu (with ~120 font files) or commit to adding all those fonts to the repo, but maybe there is a better approach. It would be good to have quick access to them.

Lorp avatar Mar 11 '21 22:03 Lorp

Cool. It would be really helpful if samsa supports the google vf fonts. I also think we don't need to add them to menu or upload them to repo.

Thank you for your reply.

crypto-dump avatar Mar 12 '21 13:03 crypto-dump

Can't sure if this can help you.

https://github.com/RoelN/google-variable-fonts-links

crypto-dump avatar Mar 12 '21 13:03 crypto-dump

Good point, I should have mentioned Roel’s tool. If you can come up with a UI concept, it would help me consider this further.

If the GF fonts are not in the menu, how would they be accessed? Using JavaScript’s fetch() API, one only has access to files stored on the same domain as the app.

Perhaps the GF repo should be included in the Samsa repo as a submodule.

Lorp avatar Mar 12 '21 13:03 Lorp

Actually, I was building variable fonts plugin for figma. and I thought we can show all google fonts to the menu for this plugin. On samsa, I think we can use infinite loader for the long google font list.

crypto-dump avatar Mar 12 '21 17:03 crypto-dump

I’ll think about it. I don’t want the default installation to have any expectation that the Google Fonts are there. One solution would be an additional script that populates samsa-config.js, and users run this if they wish. I’d have to reimplement a dropdown control for an infinite loader, as there’s no event fired when navigating <select> controls… perhaps a “load more” entry would work, but I don’t want a very long list or lots of clicks on “load more”.

Good to hear you’re building a Figma plugin.

Lorp avatar Mar 14 '21 13:03 Lorp