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

Add TTF support to CLI #570

Closed
bartvanandel opened this issue Sep 12, 2022 · 8 comments · Fixed by #737
Closed

Add TTF support to CLI #570

bartvanandel opened this issue Sep 12, 2022 · 8 comments · Fixed by #737
Labels
enhancement New feature or request

Comments

@bartvanandel
Copy link

bartvanandel commented Sep 12, 2022

Is your feature request related to a problem? Please describe.
We're currently developing an app in React-Native, using Expo, and we need to use custom fonts (specifically, Barlow). While searching for a package that provides this font, I bumped into this excellent fontsource thing. Unfortunately, the fonts are only provided as .woff and .woff2, which is not supported on Android (see e.g. Expo documentation).

Describe the solution you'd like
It would be very nice if you could also expose .otf (and/or ttf) fonts, which seem to be the best supported font format across all platforms.

Describe alternatives you've considered
Alternatives in our case would be to bundle the fonts manually (which works fine, but requires keeping an eye on updated fonts manually), or use another package, which as far as I can tell don't offer as nice as a feature set (incl. easily switching to other, similar fonts) as yours.

Additional context
none at this point

@bartvanandel bartvanandel added the enhancement New feature or request label Sep 12, 2022
@ayuhito
Copy link
Member

ayuhito commented Sep 12, 2022

Would #555 be a solution for you?

While TTF/OTF files aren't in our NPM packages (due to NPM package size restrictions), we do actually have downloads including TTF/OTF files available right now with the small download button found on the top bar of the current website.

@ayuhito
Copy link
Member

ayuhito commented Sep 12, 2022

Perhaps email notifications for updates could be a feature to extend #555 and be more useful to you.

@bartvanandel
Copy link
Author

#555 would be a nice resource to have available for font downloads in general, but it would still require manual work to stay up-to-date. If npm package size is the restricting factor, maybe this package could offer an npm script to download the font in a specific format (e.g. with options for otf, ttf, woff, woff2, etc)? Then we could add a postinstall script to our own package.json file to download the fonts after the package has been installed.

@bartvanandel
Copy link
Author

For the time being though, I'm just going to have to download the fonts by myself. Gotta move forward. But having this option in the future would be nice!

@bartvanandel
Copy link
Author

I've added our solution to a public gist, maybe you can use some of it: https://gist.github.com/bartvanandel/19921f48ce134c393bb38bb2c8887247

@ayuhito
Copy link
Member

ayuhito commented Oct 3, 2022

Thanks! This gives me a lot more insight into how I would want to structure #562 to be beneficial to many people. I want to make most of the functionality of this project to be fully portable for teams to utilise.

@bartvanandel
Copy link
Author

You're welcome! I do realize that our script is definitely cutting some corners, for instance, it would for sure benefit from some kind of hash match or version storage, so we can keep the number of downloads to a minimum instead of on every npm install, but for now this was good enough for us.

@ayuhito ayuhito mentioned this issue Oct 22, 2022
16 tasks
@ayuhito ayuhito changed the title Add support for native apps Add TTF support to CLI Oct 23, 2022
@ayuhito
Copy link
Member

ayuhito commented May 23, 2023

Now that V5 is released, I think we could store all the TTF files into the font-files quite easily. We have all the necessary metadata to do so.

We just need to ensure when publishing to NPM, those TTF files are just ignored, as well as find all the TTF sources for all non-google custom fonts we host.

This was referenced May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants