This repo contains images that are representations of all the different Google Fonts. We needed this for our app Stencil, since we allow our users to search through Google Fonts (via their API). But we (obviously) wanted/needed to provide them with a preview of what the font looked like.
We could have loaded the fonts into memory and then shown those, but that didn't seem ideal.
If you're interested in a hosted version of the screenshot you see below
(allowing your users to trigger a modal, and a button-click bubbling up an event
that contains the URL of the corresponding woff2 file), please let me know:
[email protected]
While Google Fonts currently provides thousands of different font variations, there are many-more actual images. This is because Google Fonts routinely updates fonts from one version to another (eg. v5 to v6). We then re-render the images to ensure the preview we show our users is accurate.
I've decided to leave those files in the repo for posterity's sake: you never know what people will need :)
At the moment, I'm only providing preview images that have a font-size value
of 48px. The width respects the native width of the font. To ensure a sharp
display, I'd suggest you hardcode the preview thumb at a maximum height of
24px.
Two examples: ABeeZee-400.v10.png and Cabin-400italic.v10.png
The format is pretty straight-forward:
-)italic is addedvThe regular expression I use to strip out the name-characters is:
/[^A-Za-z0-9-]/