Fonts are usually the largest files on a typographic page. The plugin loads each font only on the pages that use it.
How does per-page font loading work?
Content refers to fonts with a CSS variable, for example var(--font-12). Before the page renders, the plugin scans the content and collects the font IDs. It then writes @font-face rules only for those fonts. A font that one page uses does not download on other pages.
To load a font on every page, for example a font that only your theme CSS uses, select Load on all pages on its card. A developer can also use the typost_force_enqueue_font_ids filter. See Theme integration.
Why do archive pages work differently?
WordPress runs the main query late.
On a single post, WordPress knows the post early, so the plugin can detect fonts when it adds the page assets. On archive pages, for example the blog home and category, tag, date, and author pages, the posts are not available yet at that time. The query has not run. Detection would find nothing and load no fonts, and the archive would show a fallback font.
So on archive pages, the plugin detects fonts at template_redirect, after the query runs. It keeps the result for the next step, which adds the assets.
The Options setting Check full post content on archive pages (recommended) controls this scan. When it is on, the plugin checks the full content of each post on the archive page. It is on by default.
What is cached?
The plugin caches its detection results and the CSS that it makes, in transients that last 12–24 hours. The caches clear automatically when plugin options change. To clear them yourself, click Clear Font Cache at Settings → Typography Stylist → Options.
When should I clear the cache?
- Clear it after you change the fallbacks of a font or replace a font.
- Clear it when a font does not show on the frontend but works in the editor.
- Clear it after you change a lot of content, if the change affects which fonts a page uses.
If a page is correct in the editor but not on the frontend, check the detection cache first.
What else loads only when needed?
- The settings page loads fonts only for the tab that is open. On the Custom Fonts tab, a font loads when its card comes into view.
- The block editor loads only the Adobe Fonts kits that the post uses. When you pick or preview another Adobe font, its kit loads then.
- A single post or page prints CSS only for the paragraph styles that it uses. Archive pages, the blog page, and search results print all styles.
Is there JavaScript on the frontend?
The plugin does its styling with CSS only: font-feature-settings, font-variation-settings, font-family, and sizes.
Fit-to-width also uses no script. The editor measures each line, and the saved content stores the sizes. CSS container queries apply them in the browser.
How do I keep font loading fast?
- Subsets: Subset your fonts if the license allows it. A display font needs far fewer characters than a body text font.
- Variable fonts: Use a variable font when you would otherwise load three or more weights.
- WOFF2: Use WOFF2 files. They are smaller than WOFF files, and all current browsers support them.
- Fallbacks: Set fallbacks that are similar in width, so that the change is less visible.
- Fewer fonts: Do not add a font for one small decoration.