Sub topic 7
Adding Adobe Fonts through a web project
Adobe Fonts delivers fonts through a web project. This chapter covers how to create one, how to add its stylesheet to a page, how to use the fonts in CSS, and how to fix the most common errors.
This chapter assumes you know the basics of HTML, the link element, and CSS selectors. It also assumes you can open the Network and Elements panels in your browser's developer tools. You should already have read the previous chapters on Adobe Fonts' catalog and licensing, and on font stacks.
How Adobe Fonts delivery works
Google Fonts lets you build a URL from a family name. Adobe Fonts works differently. You can't point a link tag at a font family. You first create a container called a web project. Then you add fonts to the project, and Adobe gives you one stylesheet URL for the whole project.
A web project is a named collection of fonts. It has these properties:
- It has a unique project ID, which appears in the stylesheet URL.
- It holds the fonts you chose, along with the weights and styles of each.
- It has a list of allowed domains. Fonts load only on the sites you list. This is a licensing control.
- It is tied to your Adobe account. If your subscription lapses, the fonts stop loading.
The stylesheet the project serves is hosted at use.typekit.net. Typekit was the original name of the service, and the hostname has stayed. When the browser loads that stylesheet, the stylesheet contains @font-face rules that point to the actual font files on Adobe's servers.
Note the order. The browser requests the font files only after it has parsed the stylesheet and found text on the page that uses them. A slow stylesheet therefore delays the fonts as well.
Creating a web project
You do these steps in the Adobe Fonts website while signed in with an Adobe account. The interface changes from time to time, so look for the labels rather than relying on exact positions.
- Open the Adobe Fonts site and browse or search for a font family.
- Open the family page. Check the available weights and styles, and check that the family is marked as available for web use.
- Choose the option to add the family to a web project. If you have no project yet, choose to create one.
- Give the project a name that describes the site, such as "Marketing site" or "Docs". The name is for you. It doesn't appear in the code.
- In the project settings, choose which weights and styles to include. Select only the ones you will use.
- Add your domains to the project's domain list. Include any staging domain you test on.
- Copy the embed code that the project page shows.
The embed code is the link tag from this chapter's next section. The project page also shows the CSS family name for each font. You need that name in your CSS, and it is often not the same as the display name.
Choose weights and styles with care
Every weight and style in a project is a separate font file. A project that includes regular, italic, bold, and bold italic of one family makes the browser able to download four files. More files means more bytes. The browser downloads only the files for styles the page actually uses, but extra styles still increase the stylesheet size and the chance that text uses a style you did not plan.
A rule of thumb is to start with the regular and bold weights, add italic only if the content has real emphasis or citations, and add more weights only when the design calls for them.
Linking the project stylesheet
Place the project stylesheet in the head of every page that uses its fonts. Replace your-project-id with the ID from your own project.
<link rel="stylesheet" href="https://use.typekit.net/your-project-id.css">After this tag loads, the fonts in the project are available to CSS under the family names that Adobe assigns. Nothing else is needed in the HTML.
Preconnect for a faster start
The browser must open a connection to use.typekit.net for the stylesheet and then to the font host for the files. You can start the first connection earlier with a preconnect hint placed before the stylesheet link.
<link rel="preconnect" href="https://use.typekit.net" crossorigin>
<link rel="stylesheet" href="https://use.typekit.net/your-project-id.css">Preconnect saves the time of the DNS lookup, TCP handshake, and TLS negotiation. It helps most on a first visit. Use it only for hosts you will definitely use, because each open connection has a small cost.
Alternative: `@import`
You can also import the project stylesheet from your own CSS.
@import url("https://use.typekit.net/your-project-id.css");This works, but it is slower than the link tag. The browser must download your CSS file first, find the @import, and only then request the project stylesheet. The two requests happen one after the other instead of in parallel. Prefer the link tag. Note also that @import must appear at the top of the stylesheet, before any other rules, or the browser ignores it.
Using the fonts in CSS
Once the stylesheet is loaded, you use the fonts through font-family. The name you write must match the CSS name that Adobe shows on the project page. Names are usually lowercase with hyphens, for example proxima-nova.
h1, h2 {
font-family: "proxima-nova", Helvetica, Arial, sans-serif;
font-weight: 700;
}This assumes the project includes Proxima Nova at weight 700. The rest of the list is a fallback stack. If the project fails to load, or the font is still downloading, the browser uses Helvetica, then Arial, then any sans-serif font. See the chapter on font stacks for how to choose fallbacks that look close to the web font.
Weight and style in CSS must match what the project includes. The browser picks a font file by comparing the requested font-weight and font-style with the faces defined in the stylesheet.
| CSS you write | What the browser does if the project has it | What happens if the project lacks it |
|---|---|---|
| `font-weight: 700` | Uses the 700 face | Uses the nearest face, or synthesizes bold from regular |
| `font-style: italic` | Uses the italic face | Slants the regular face artificially (faux italic) |
| `font-weight: 300` | Uses the 300 face | Uses the nearest weight, often 400 |
Synthesized bold and italic look worse than real ones. If you see uneven letter shapes, check that the project includes the face you request.
A complete example
This page uses one Adobe font for headings and system fonts for body text. It is a full file you can save and open once you replace the project ID and font name with your own.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Adobe Fonts demo</title>
<link rel="preconnect" href="https://use.typekit.net" crossorigin>
<link rel="stylesheet" href="https://use.typekit.net/your-project-id.css">
<style>
body {
font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
line-height: 1.5;
max-width: 40rem;
margin: 2rem auto;
}
h1, h2 {
font-family: "proxima-nova", Helvetica, Arial, sans-serif;
font-weight: 700;
}
</style>
</head>
<body>
<h1>Heading in the project font</h1>
<p>Body text in the system font stack.</p>
</body>
</html>If the project ID is wrong, the page still renders. The headings simply show the fallback font. That is the fallback stack doing its job, and it is also why a broken embed can go unnoticed.
Domains, licensing, and subscription limits
Adobe Fonts is included with an Adobe Creative Cloud subscription, and a free tier with a smaller selection exists in some plans. The details of plans change, so check the current terms. The facts that matter for a web project are these:
- Fonts load only on domains you list in the project. A request from an unlisted domain gets no fonts.
- You can't download the web font files from the project and host them yourself. The license is for delivery through Adobe's service. If you need self-hosting, use an openly licensed font instead, as covered in the self-hosting chapter.
- If the subscription ends, the project stops serving fonts and your site falls back to the fallback stack. The site still works, but it looks different.
- Fonts are marked for web use, desktop use, or both. A font that is desktop-only can't be added to a web project.
- Projects may have a page-view allowance depending on the plan. Check the limits if the site has high traffic.
Loading behavior
The project stylesheet sets its own font-display behavior. Adobe uses a setting that shows fallback text first and swaps in the web font when it arrives, so text stays visible during loading. You can't change that value by editing your own CSS, because the @font-face rules belong to the project stylesheet. This is one difference from self-hosting, where you write the rule yourself and choose the value.
What you can control is how bad the swap looks. When the web font replaces the fallback, the text may change width, and lines may wrap differently. This causes a layout shift. You can reduce it by:
- Choosing fallback fonts with similar proportions to the web font.
- Setting a stable
line-heightand reserving space for headings. - Limiting the number of fonts and weights so there is less to swap.
- Using preconnect, so the swap happens sooner.
The chapter on font-display, preconnect, and layout shifts covers these techniques in detail.
Troubleshooting
Most problems fall into a few groups. Work through them in order, using the developer tools.
- The stylesheet request fails. Open the Network panel and filter for
typekit. If the request returns 404, the project ID is wrong. Copy the embed code from the project page again. - The stylesheet loads but the fonts do not. Look for the font file requests. If there are none, your CSS may not use the family name, or no element uses the font. The browser downloads only fonts that the page's text needs. If the requests are blocked or return an error, check the domain list.
- The fonts load on production but not locally or on staging. The domain list probably omits your development host. Add it to the project. Adobe provides handling for
localhost, but verify this in the project settings for your account. - The font name does not match. The CSS name is often different from the display name. Copy it from the project page. Check the spelling and quotes.
- The weight looks wrong. The project may not include the weight you requested. Open the project settings and add it, or change your CSS to a weight the project has.
- The change does not appear after editing the project. Changes to a project can take a short time to propagate, and your browser may cache the old stylesheet. Reload without the cache and try again.
- A content blocker hides the fonts. Some privacy tools block third-party font hosts. Test in a clean browser profile. A good fallback stack keeps the site readable for these visitors.
To confirm which font the browser actually used, open the Elements panel, select a heading, and open the Computed tab. The rendered fonts section lists the font file the browser used for that element, so you can tell the web font from a fallback.
Key points
- A web project is the container that holds your chosen fonts, allowed domains, and stylesheet URL.
- Link the project stylesheet with a
linktag in thehead. Prefer it over@import. - Use the CSS family name shown on the project page, and always add a fallback stack.
- Include only the weights and styles the design needs.
- You can't self-host Adobe fonts, and a lapsed subscription stops the fonts from loading.
Exercise
A teammate adds a project stylesheet link to a page and sets font-family: "Proxima Nova", sans-serif; on the headings. The Network panel shows the stylesheet loaded with status 200, but the headings display in the default sans-serif font and no font file requests appear. What is the most likely cause, and how do you fix it?
Show answer
The CSS family name does not match the name Adobe assigned. The project page lists the CSS name, which is usually lowercase and hyphenated, such as "proxima-nova". The browser finds no matching @font-face rule, so it uses the fallback and requests no font file. Copy the exact name from the project page and use it in font-family.
Exercise
A site works on production, but on the staging server the fonts never load and the stylesheet request succeeds. Name two things to check, and explain why you cannot solve a licensing-related failure by uploading the font files to your own server.
Show answer
Check that the staging domain is in the web project's domain list, and check that the project has not been changed or the subscription has not lapsed. You cannot self-host because the Adobe Fonts license allows delivery only through Adobe's service. The font files are not available to download for your own hosting, so the only supported fix is to adjust the project.