GithubHelp home page GithubHelp logo

fabiospampinato / ifont Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 0.0 64 KB

An isomorphic icon font generator with support for ligatures.

License: MIT License

JavaScript 89.40% TypeScript 10.60%
font generator icon isomorphic ligatures ttf

ifont's Introduction

iFont

An 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.

Install

npm install --save ifont

Usage

You would use the CLI commands like this:

# Build an icon font from some SVG icons
ifont build -i resources/icons/*.svg -o dist/IconFont.ttf

# Preview an icon font from some SVG icons
ifont preview -i resources/icons/*.svg

# List icons by bytes needed once added to the TTF font
ifont stats -i resources/icons/*.svg

You would use the programmatic API like this:

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: '<svg>...</svg>' }
    { name: 'square', content: '<svg>...</svg>' },
    { name: 'triangle', content: '<svg>...</svg>' }
  ]
});

fs.writeFileSync ( 'IconFont.ttf', ttf );

License

  • svg2ttf: MIT © Vitaly Puzrin
  • Rest: MIT © Fabio Spampinato

ifont's People

Contributors

fabiospampinato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.