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.
FAQ
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