icofon

A folder of SVGs in, an icon font out — one command.

The icofon mark — a stylized letter A in a blue-to-purple gradient inside a rounded square badge

A command-line tool that turns a folder of SVG icons into an icon font: WOFF2, WOFF and TTF, a stylesheet with one class per icon, and a searchable preview page.

Most of the work is getting drawings into a shape a font can hold. A font can only fill, so strokes are traced into outlines of their own; evenodd holes are rewound to survive non-zero winding; white shapes and faint washes are read as background rather than ink, becoming knock-outs over artwork and nothing over empty space. Icons that use more than one color come out as COLR/CPAL layers instead of a flattened blob, and layers painted currentColor still follow your CSS.

Codepoints live in icofon.json beside the icons, keyed by file path — so dropping in a new icon never shifts the ones already published and cached. Builds are reproducible, and icofon check fails CI on any SVG that cannot become a glyph.

Rust, MIT, installed as a prebuilt binary: brew install jwo1f/tap/icofon.