WP FOFT Loader
This plugin implements and automates Zach Leatherman’s “Critical FOFT with preload, with a polyfill fallback emulating font-display: optional” to optimize and speed up web font loading and improve UX by minimizing Flash of Invisible Text, Flash of Unstyled Text, and DOM Reflow. Acknowledgement This
This plugin implements and automates Zach Leatherman’s “Critical FOFT with preload, with a polyfill fallback emulating font-display: optional” to optimize and speed up web font loading and improve UX by minimizing Flash of Invisible Text, Flash of Unstyled Text, and DOM Reflow.
Acknowledgement
This plugin is based on Hugh Lashbrooke’s Starter Plugin , a robust and GPL-licensed code template for creating a standards-compliant WordPress plugin.
PRO only features
- Support for 7 additional font-weights
- Small-caps support
- Finer-grained control of default CSS
- Default options reset
- Warn user of unsaved changes when navigating plugin tabs
Configuration
Video Tutorials
Episode 1. Intro and Background
Episode 2. Font Squirrel Generator (WOFF & WOFF2)
Generating and Uploading the Font Files
Upload two files for each web font: a WOFF file and a WOFF2 file. We recommend you use Font Squirrel’s Webfont Generator to generate the files. Mandatory Font Squirrel settings are:
Select “Expert” Font Formats: “WOFF” “WOFF2” Advanced Options: “Font Name Suffix” = -webfont
For detailed recommended settings, see the plugin Upload options screen.
Filenames must follow the proper naming convention: $family – $variant -webfont. $filetype .
$family
The font family base name without style. Case-insensitive. May contain letters, numerals, and underscores but no hyphens or spaces.
$variant
The font style. Can be weight, style, or a combination of both. Case-sensitive .
-webfont
Mandatory suffix. Append to $variant.
$filetype
The file type, i.e., “woff” or “woff2”.
Example : for the bold weight italic style of Times New Roman, rename the files to timesnewroman-boldItalic-webfont.woff and timesnewroman-boldItalic-webfont.woff2.
Allowed weights and styles and their CSS mappings are:
- regular | normal (maps to 400)
- italic (maps to 400)