How to Export a Font Subset Using FontForge
Subsetting a font allows you to strip away unused glyphs, significantly reducing file sizes for faster web performance and cleaner font management. This guide outlines the straightforward process of importing your font into the free, open-source FontForge editor, selecting your desired characters, removing unwanted glyphs, and exporting the streamlined, subsetted font file in your preferred format.
Step 1: Open Your Font in FontForge
- Launch FontForge.
- Go to File > Open.
- Locate and select the font file (
.ttf,.otf, or.woff) you wish to subset, then click OK.
Step 2: Select the Glyphs You Want to Keep
Before deleting unneeded characters, you must identify the characters you intend to keep.
- Manual Selection: Hold
Ctrl(orCmdon macOS) and click on individual glyphs, or holdShiftto select contiguous ranges. - Range Selection: Go to Edit > Select > Select by Wildcard... or use Unicode ranges to select predefined blocks, such as Basic Latin.
Step 3: Invert the Selection
Once your desired characters are highlighted, reverse the selection to target all the glyphs you want to discard:
- Click Edit in the top menu bar.
- Navigate to Select > Invert Selection.
- All glyphs except the ones you intend to keep will now be highlighted.
Step 4: Delete the Unwanted Glyphs
- With the unneeded glyphs highlighted, go to Edit > Clear.
- Alternatively, press the
DeleteorBackspacekey. - The selected glyph slots will now be empty.
Step 5: (Optional) Detach Glyphs from the Encoding
To ensure the empty slots are completely removed from the font layout rather than remaining as empty spaces:
- Go to Encoding > Compact.
- This collapses the view so that only the remaining glyphs are displayed.
Step 6: Generate the Subsetted Font
- Go to File > Generate Fonts...
- In the dialog box, choose a destination folder and enter a new name for your font (it is best practice not to overwrite your original file).
- Select your output format from the dropdown menu (e.g., TrueType, OpenType (CFF), or Web Open Font Format (WOFF/WOFF2)).
- Click Generate.
- If FontForge displays a warning regarding non-standard glyph names or minor validation errors, review them and click Generate to proceed with the export.