Skip to content

matsilva/installfont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

installfont

Nodejs module for installing system fonts. This module is not tightly coupled to any specific font libraries or apis. It also is not opinionated about how you get the fonts on your machine.

Compatible OS:

  • Mac OS
  • Windows
  • Ubuntu 14.0.4.1 LTS

Run as Admin on linux or OSX

###Assumptions

  • Assumes font file(s) are downloaded to your machine, but not yet installed.

Installation

Open your command line and run npm install installfont

Usage

Installing a single font file

var installfont = require('installfont');

installfont('path/to/your/font.ttf', function(err) {
  if(err) console.log(err, err.stack);
  //handle callback tasks here
});

Installing all font files within a specified directory

var installfont = require('installfont');

installfont('path/to/dir/containing/fonts', function(err) {
  if(err) console.log(err, err.stack);
  //handle callback tasks here
});

Options

Pass installfont an options parameter as a third argument

var installfont = require('installfont');

var options = {
  removeFonts: true
};

installfont('path/to/dir/containing/fonts', function(err) {
  if(err) console.log(err, err.stack);
  //handle callback tasks here
}, options);

removeFonts - Pass true or false to specify if you want your font file(s) to be deleted after they are installed. Defaults to false;

About

Super easy nodejs system font installation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published