Skip to content

A program for converting fonts to and from WOFF for Mac OS

License

Notifications You must be signed in to change notification settings

jcfieldsdev/font-converter

Repository files navigation

font-converter

An application for converting fonts from TrueType to WOFF/WOFF2. Written in Objective-C/C++. Requires Mac OS 10.12 (Sierra) or higher.

Font Converter

Releases

Binary versions are available on the Releases page.

Binaries are self-signed but not notarized, so Mac OS 10.15 (Catalina) and higher display an error upon launching it. Right-click the application icon and select "Open" to enable the option to bypass this security warning.

Guide

Converting fonts

There are a few ways to add fonts to convert:

  • Select "Add Fonts" from the "File" menu or toolbar (or use the keyboard shortcut Cmd+O) and pick the font files in the file chooser.
  • Drag-and-drop the font files from the Finder onto the queue in the application window or onto the Dock icon.
  • Select the font files in the Finder, then select the application menu, the "Services" submenu, and the "Font Converter" menu item.

Fonts in the TrueType (.ttf, .otf) format are converted to WOFF/WOFF2, and fonts in the WOFF/WOFF2 (.woff, .woff2) format are converted to TrueType.

Other options

If you have at least one font selected, you can select "Show in Finder" from the "File" menu or toolbar (or use the keyboard shortcut Cmd+Shift+R) to open the containing folder in the Finder.

You can select "Copy CSS" from the "File" menu or toolbar to copy CSS @font-face rules for the converted fonts to the clipboard. This only works for fonts that have completed conversion. The program tries to determine the generic font family (serif, sans serif, or monospace), style (italic), and weight (bold) of each file, as in the following example output:

@font-face {
	font-family: "Mohave";
	font-style: normal;
	font-weight: bold;
	src: url("Mohave-Bold.woff2") format("woff2"), url("Mohave-Bold.woff") format("woff"), url("Mohave-Bold.ttf") format("truetype");
}

@font-face {
	font-family: "Mohave";
	font-style: italic;
	font-weight: bold;
	src: url("Mohave-BoldItalic.woff2") format("woff2"), url("Mohave-BoldItalic.woff") format("woff"), url("Mohave-BoldItalic.ttf") format("truetype");
}

@font-face {
	font-family: "Mohave";
	font-style: italic;
	font-weight: normal;
	src: url("Mohave-Italic.woff2") format("woff2"), url("Mohave-Italic.woff") format("woff"), url("Mohave-Italic.ttf") format("truetype");
}

@font-face {
	font-family: "Mohave";
	font-style: normal;
	font-weight: normal;
	src: url("Mohave-Regular.woff2") format("woff2"), url("Mohave-Regular.woff") format("woff"), url("Mohave-Regular.ttf") format("truetype");
}

However, it cannot determine cursive or fantasy fonts or weights besides "normal" and "bold."

Preferences

You can open the Preferences window by selecting it from the application menu (or use the keyboard shortcut Cmd+,).

Preferences Window

Output format determines whether the program generates WOFF files, WOFF2 files, or both. WOFF2 has better compression, but WOFF has wider browser support. Each format has a Compression level slider, where lower values provide faster compression and decompression but higher values provide smaller file sizes.

WOFF2 also has the Allow transforms option, which determines if additional transforms are done to the glyf, loca, and hmtx tables of the font (see the WOFF2 format specification). If this option is deselected, these tables are left in their original, uncompressed form.

Acknowledgments

Incorporates sfnt2woff-zopfli by Bram Stein, itself derived from sfnt2woff by Jonathan Kew of Mozilla and the Zopfli compression algorithm by Lode Vandevenne and Jyrki Alakuijala of Google.

Incorporates WOFF2 and Brotli code by Google.

Uses compress, plus, folder open, copy, times, broom, and check icons by Font Awesome.

Authors

License