An isomorphic icon font generator with support for ligatures.
npm install ifontAn isomorphic icon font generator with support for ligatures.
It generates a single TTF file from a list of SVG icons and their names, mapping each name to a ligature.
It works in the browser too.
``sh`
npm install --save ifont
You would use the CLI commands like this:
`shBuild an icon font from some SVG icons
ifont build -i resources/icons/*.svg -o dist/IconFont.ttf
You would use the programmatic API like this:
`ts
import ifont from 'ifont';
import fs from 'node:fs';// Generate a TTF font, as a Uint8Array, from some SVG icons
const ttf = ifont ({
icons: [
{ name: 'circle', content: '' }
{ name: 'square', content: '' },
{ name: 'triangle', content: '' }
]
});
fs.writeFileSync ( 'IconFont.ttf', ttf );
`License
-
svg2ttf`: MIT © Vitaly Puzrin