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

Ability to load Google font and upload custom fonts #63

Open
crypto-dump opened this issue Mar 11, 2021 · 6 comments
Open

Ability to load Google font and upload custom fonts #63

crypto-dump opened this issue Mar 11, 2021 · 6 comments

Comments

@crypto-dump
Copy link

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

@Lorp
Copy link
Owner

Lorp commented Mar 11, 2021

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.

@crypto-dump
Copy link
Author

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
Copy link
Author

Can't sure if this can help you.

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

@Lorp
Copy link
Owner

Lorp commented Mar 12, 2021

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.

@crypto-dump
Copy link
Author

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.

@Lorp
Copy link
Owner

Lorp commented Mar 14, 2021

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.

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

2 participants