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 fallback family to the code sample #379
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/fontsource/fontsource/E7V8FiPU8Xk7sXi4YSpSFmww3G63 |
Great idea. I think we can go one step further with this PR and implement it to font previews documentation too. There is metadata per font preview that shows whether it is sans-serif, serif or monospace, so it'll be fairly easy to automatically show the correct one on the preview. Would you be interested in giving that a go? |
Yes, that makes sense. I'll look into that! |
Well, the problem is the there are around 1345 fonts that needs to be specified as:
Unfortunately it’s a manual and quite time-consuming process. It’s possible to gather such data from Google Fonts
But I’m not sure if I’m ready to automate it myself. |
My bad, I feel I should add more documentation regarding the internal workings of the website when I get the chance. I've been besieged with so much work recently to keep track with this project though. FontPreview.tsx is passed a Note the categories Fontsource metadata give is the following:
You can go to the Fontsource font preview search and filter by those categories for reference. |
@pepelsbey, just checking in if you're still interested in this PR or someone else should jump in to take care of it? |
@DecliningLotus sorry, I’ll give a go on weekend and if nothing comes out of it, I’ll let you know. |
No pressure at all! I was just checking in! |
I'll merge this PR and post a new issue (#410) to see if anyone else is interested in undertaking this idea. Thank you for your initial contribution though! |
Otherwise the default Times New Roman serif font will be used before the Open Sans loads.
Generic fallback font family is considered as a good practice. It usually make font switch less obvious for users, so it’s good to have it in the code sample as a reminder.