Fork me on GitHub

Fontina


Fontina is a node.js module which generates .ttf, .otf, .svg, .woff, .eot fonts from (nearly) every font format.
A @font-face ready stylesheet will be created as well, making you ready to face the web with your best fonts.

Requirements

Before using Fontina you need to install:

OS X
Arch Linux
Windows
brew install fontforge ttf2eot
yaourt -S fontforge ttf2eot
# Install fontforge and ttf2eot manually
# Add the executables to PATH

Basic usage

npm install --save fontina
var fontina = require('fontina');
var options = {};
fontina('./fonts/font.ttf', './public/fonts', options);

Fontina will do the rest.

The options object can be configured as follow:

{
  force: false,   // if true the file extension won't be checked
  output: false,  // if true the output from the tool will be printed
  error: false,   // if true the errors from the tool will be printed
  cwd: null       // current directory from which the tools are run
}

Integration with Grunt

Install grunt-fontina to automate your workflow.

npm install --save grunt-fontina

Load a new task in your Gruntfile.js:

grunt.loadNpmTasks('grunt-fontina');

Add a configuration block for Fontina:

fontina: {
  fonts: {
    src: './fonts',           // Source directory
    dest: './public/fonts',   // Output directory
    options: {                // Fontina options object
      output: true
    }
  }
}