/**
 * Figlet JS node.js module
 * 
 * Copyright (c) 2010 Scott González
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 * 
 * http://github.com/scottgonzalez/figlet-js
 */

var Figlet = require("./figlet").Figlet;

Figlet.loadFont = function(name, fn) {
	require("fs").readFile("./fonts/" + name + ".flf", "utf-8", function(err, contents) {
		fn(contents);
	});
};

exports.Figlet = Figlet;


/**
 * Figlet JS node.js module
 * 
 * Copyright (c) 2010 Scott González
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 * 
 * http://github.com/scottgonzalez/figlet-js
 */

var fs = require("fs");
var path = require('path');
var Figlet = require("./figlet").Figlet;

Figlet.loadFont = function(name, fn) {

	var fontFileName = name + ".flf";
	
	var filePath = path.resolve(__dirname, "fonts",  fontFileName);

	fs.readFile(filePath, "utf8", function(err, contents) {

		if (err) {throw err;}
		// console.log('figlet-node.loadFont', err, contents);

		fn(contents);
	});
};

exports.Figlet = Figlet;

Clean up figlet font loading for node
Clean up figlet font loading for node
