FontForge Font Compression Options Explained
FontForge offers several compression methods and format-specific settings to reduce font file sizes during the export process. When exporting through the Generate Fonts interface, compression is achieved either through dedicated compressed web font wrappers like WOFF and WOFF2, compression-enabled legacy formats like SVGZ, or internal outline optimizations such as CFF subroutinization.
WOFF (Web Open Font Format)
When selecting Web Open Font Format (WOFF) from the Generate Fonts dropdown, FontForge applies table-level compression to the font's underlying sfnt structure.
- Compression Algorithm: WOFF uses standard
zlib(deflate) compression. - Functionality: Each table within the font (such as
glyf,loca, orCFF) is compressed individually before being packaged into the WOFF container. - Compatibility: Supported natively across all modern and legacy web browsers without requiring third-party command-line compression tools.
WOFF2 (Web Open Font Format 2.0)
WOFF2 is the successor to WOFF and offers significantly higher compression ratios, often reducing file sizes by an additional 30% compared to standard WOFF.
- Compression Algorithm: WOFF2 uses the Brotli compression algorithm combined with table-specific preprocessing transforms.
- Requirements: FontForge must be built with
libbrotlisupport enabled. If compiled without Brotli libraries, the WOFF2 option may be disabled or missing from the format selection menu. - Preprocessing: It transforms the
glyfandlocatables into a unified, more compact stream prior to Brotli compression.
SVGZ (Compressed SVG Fonts)
For legacy vector web formats, FontForge allows exporting fonts as SVG.
- Compression Algorithm: Selecting SVGZ applies
standard
gzipcompression directly to the XML-based SVG font file. - Use Case: Primarily used for older mobile platforms (such as legacy iOS versions) that required vector SVG glyph definitions without the overhead of uncompressed text-based XML.
CFF Subroutinization (Internal Outline Compression)
When generating PostScript-flavored OpenType fonts
(.otf), FontForge provides internal data compression
through Compact Font Format (CFF) subroutinization rather than
container-level file compression.
- How It Works: In the Generate Fonts "Options" dialog, checking the subroutinize option instructs FontForge to search for identical path sequences across different glyphs and replace them with shared subroutines.
- Impact: This reduces the overall size of the
CFFtable without altering the format extension or requiring decompression software in the target environment.
PCF / Bitmap Font Compression
When generating bitmap distributions (such as X11 PCF fonts), FontForge provides direct compression options in the font generation dialog:
- Formats: PCF fonts can be output with
.pcf.Z(Unixcompress) or.pcf.gz(gzip) compression. - Use Case: Reduces disk usage for system bitmap fonts in Unix/Linux terminal environments.