How fonts are optimized in Framer
All sites in Framer use web or custom fonts, which must load in the browser before rendering. To speed up text rendering, Framer applies several optimizations.
Best practices
Use web fonts with weights from Light (300) to Extra Bold (800). Text with these weights won’t be hidden during loading, thanks to the
font-display: swaprule.Choose Google Fonts when possible. Fonts from Google load faster due to automatic subsetting. Select them from the “Web” tab instead of uploading them manually.
Kinds of fonts
Framer supports five types of fonts:
Google Fonts: Available under “Font” in the “Google” tab and sourced from fonts.google.com.
Fontshare fonts: Available under “Font” in the “Fontshare” tab and sourced from www.fontshare.com.
Custom fonts: Fonts you upload into Framer, accessible under “Font” in the “Custom” tab.
Open-source fonts: Fonts sourced from various font foundries.
Framer font alternatives: Inter and Inter Display fonts, used as default fonts for new text blocks.
Each type is optimized differently depending on its source and use.
font-display: swap
This CSS rule tells the browser to display a system font while the web font loads, reducing perceived loading time.
Applies to all fonts, with the following specifics:
Only applies to weight Light (300) to Extra Bold (800)
For Google and Fontshare fonts, only applies to fonts in categories serif and sans-serif
Considerations
Rare font weights like Thin (100) do not use
font-display: swapbecause the difference between the system font and the web font would be too noticeable.Fonts from non-sans-serif categories (e.g., decorative fonts) also don’t use
font-display: swapto avoid mismatches with fallback system fonts like Arial.
Layout shift optimization
For fonts with font-display: swap, Framer calculates and applies CSS rules like size-adjust to ensure the system font closely matches the web font. This reduces or eliminates layout shifts when the web font loads.
Font subsetting
Many fonts include support for multiple alphabets (e.g., Latin, Cyrillic, Greek). If your site uses only one language, downloading unused character sets is unnecessary.
Applies to:
Google Fonts.
Framer font alternatives.
Optimization
Fonts are split into subsets (e.g., Latin, Cyrillic, Greek). Google Fonts handles subsetting automatically, while Framer subsets Standard Inter to match Google Fonts’ subsets.
The browser determines which subsets to load based on the characters used on the page, reducing font file size.
WOFF2 font compression
WOFF2 is the most modern and efficient font compression format, significantly smaller than TTF or OTF. We automatically convert all fonts (except fonts uploaded before November 2023) into WOFF2.
These optimizations ensure faster font loading and better performance across all Framer sites.
How does Framer optimize font loading for better site performance?
Framer optimizes font loading using several techniques: the font-display: swap CSS rule, font subsetting, and WOFF2 compression. The font-display: swap rule ensures that a system font is shown while the web font loads, reducing perceived loading time. For supported fonts, Framer also calculates and applies CSS rules like size-adjust to minimize layout shifts. Additionally, fonts are split into subsets (such as Latin, Cyrillic, Greek), and only the necessary subsets are loaded, reducing file size. WOFF2, the most efficient font compression format, is used for Google Fonts, Fontshare fonts, Standard Inter, and custom fonts uploaded after November 2023.
Which types of fonts does Framer support, and how are they handled differently?
Framer supports four types of fonts: Google Fonts (available under the 'Web' tab and sourced from fonts.google.com), Fontshare fonts (also under the 'Web' tab from fontshare.com), custom fonts (uploaded by users and accessible under the 'Custom' tab), and Standard Inter (the default font for new text blocks, supporting italics). Each type is optimized differently depending on its source and use. For example, Google Fonts and Standard Inter benefit from automatic subsetting and WOFF2 compression, while custom fonts uploaded after November 2023 are also compressed to WOFF2.
Are there any limitations or considerations when using certain font weights or styles in Framer?
Yes, there are some considerations. Rare font weights like Thin (100) do not use the font-display: swap rule because the difference between the system font and the web font would be too noticeable. Additionally, fonts from non-sans-serif categories (such as decorative fonts) also don’t use font-display: swap to avoid mismatches with fallback system fonts like Arial. Custom fonts uploaded before November 2023 remain in their original format unless a .woff2 file is uploaded to upgrade them.
Updated