Sub topic 3
Google Fonts: what it offers and how it is licensed
This chapter assumes you can write a basic <link> element and a CSS font-family rule. It also assumes you can open your browser's developer tools. You will learn what the Google Fonts catalog contains, how to filter it, and what its licenses let you do.
What the catalog offers
Google Fonts is a free library of font families, each with a page that lists its styles, supported languages and license. You can use it without an account or a subscription. The library has well over a thousand families.
The catalog covers these categories:
- Serif
- Sans-serif
- Display
- Handwriting
- Monospace
It includes many variable fonts. A variable font is a single file that contains a range of weights or widths instead of one file per weight.
The catalog page has filters that save time when you pick a typeface:
- Category, as listed above.
- Language and script, such as Latin, Cyrillic, Greek, Devanagari or Arabic. Check this first if your page is not only in English.
- Number of styles, which tells you how many weights and italics exist.
- Variable, which limits results to variable fonts.
Always open the family page and read its Styles list before you commit. A family with only one weight cannot give you a bold heading without the browser faking it.
How delivery works
You request a family from the Google Fonts API, and Google returns CSS. That CSS contains @font-face rules that point to WOFF2 font files on fonts.gstatic.com. The CSS also splits large families into unicode-range subsets, such as Latin, Latin Extended and Cyrillic. The browser then downloads only the subsets that match characters on your page.
You can see this yourself by requesting the stylesheet directly:
curl -s -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) Chrome/120.0 Safari/537.36" \
"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"The API reads the User-Agent header and returns the font format that browser supports. Without a browser-like header you may get a different format. The output has many @font-face blocks. Each one has a unicode-range line and a src URL.
How the fonts are licensed
Every family in the Google Fonts catalog is open source. Three licenses cover nearly all of it:
| License | Typical use in the catalog |
|---|---|
| SIL Open Font License 1.1 (OFL) | Most families |
| Apache License 2.0 | Some families, including Roboto |
| Ubuntu Font License | The Ubuntu family |
The license for each family is shown on its page, so confirm it there. In practice, these licenses give you these permissions:
- You can use the fonts on personal and commercial websites at no cost, with no page-view limit.
- You can download the font files and self-host them on your own server.
- You can embed them in documents, apps and print work.
- You can modify them and redistribute the modified versions, under the license terms.
The OFL sets these limits:
- You may not sell the font files by themselves.
- A modified version cannot use a Reserved Font Name that the original declares.
- Copies you redistribute must carry the original license text.
If you only link to the fonts from a web page, none of these limits affect you. They matter when you bundle font files with a product or modify them.
Common mistakes
- Choosing a family without checking its language support. Missing glyphs fall back to another font, and the text looks inconsistent.
- Requesting every weight. Each extra weight adds download size. Request only the ones your CSS uses.
- Assuming a family has an italic. Check the Styles list. The browser will otherwise slant the regular style, which looks poor.
- Assuming all fonts share one license. Most are OFL, but read the license line on the family page for work you redistribute.
Exercise
A client's site will be used in Polish and Russian and will bundle its fonts inside a commercial desktop app. Name two things you check on a Google Fonts family page before choosing it, and say whether the license allows the bundling.
Show answer
Check that the supported languages include Latin Extended (for Polish) and Cyrillic (for Russian), and check the Styles list for the weights and italics you need. Also read the license line. Under OFL 1.1 or Apache 2.0, bundling the font files in a commercial app is allowed. For OFL, include the license text and do not sell the font files by themselves.