Comparing version 0.0.6 to 0.0.7
@@ -54,11 +54,11 @@ #!/usr/bin/env node | ||
var cfonts = new CFONTS( | ||
program.text, | ||
program.font, | ||
program.colors, | ||
program.background, | ||
program.letterSpacing, | ||
program.space, | ||
program.maxLength | ||
); | ||
var cfonts = new CFONTS({ | ||
"text": program.text, | ||
"font": program.font, | ||
"colors": program.colors, | ||
"background": program.background, | ||
"letterSpacing": program.letterSpacing, | ||
"space": program.space, | ||
"maxLength": program.maxLength | ||
}); | ||
@@ -65,0 +65,0 @@ } |
21
index.js
@@ -19,2 +19,5 @@ /* | ||
//-------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
// Custom functions | ||
//-------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
function colorize($font, OPTIONS, $character) { | ||
@@ -42,16 +45,18 @@ | ||
//-------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
function cfonts($input, setFont, setColors, setBackground, setLetterSpacing, setSpace, setMaxLength) { | ||
function cfonts($SETTINGS) { | ||
//options | ||
var OPTIONS = { | ||
font: setFont || 'block', //define the font face | ||
colors: setColors || [], //define all colors | ||
background: setBackground || 'Black', //define the background color | ||
letterSpacing: setLetterSpacing || 1, //define letter spacing | ||
space: setSpace === undefined ? true : true, //define if the output text should have empty lines on top and on the bottom | ||
maxLength: setMaxLength || 10 //define how many character can be on one line | ||
font: $SETTINGS.font || 'block', //define the font face | ||
colors: $SETTINGS.colors || [], //define all colors | ||
background: $SETTINGS.background || 'Black', //define the background color | ||
letterSpacing: $SETTINGS.letterSpacing || 1, //define letter spacing | ||
space: $SETTINGS.space === undefined ? true : true, //define if the output text should have empty lines on top and on the bottom | ||
maxLength: $SETTINGS.maxLength || 10 //define how many character can be on one line | ||
}; | ||
var $font = JSON.parse(fs.readFileSync(__dirname + '/fonts/' + OPTIONS.font + '.json', 'utf8')); | ||
var $input = $SETTINGS.text; | ||
var $font = JSON.parse(fs.readFileSync(__dirname + '/fonts/' + OPTIONS.font + '.json', 'utf8')); //TODO: needs error handling | ||
var $output = []; | ||
@@ -58,0 +63,0 @@ for(var i = 0, length = $font.lines; i < length; i++) { //create first lines with buffer |
{ | ||
"name": "cfonts", | ||
"description": "Sexy fonts for the console", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"homepage": "https://github.com/dominikwilkowski/cfonts", | ||
@@ -20,3 +20,3 @@ "author": { | ||
{ | ||
"type": "MIT", | ||
"type": "GNU-GPL", | ||
"url": "https://github.com/dominikwilkowski/cfonts/blob/master/LICENSE" | ||
@@ -23,0 +23,0 @@ } |
@@ -39,11 +39,11 @@ ```shell | ||
var fonts = new FONTS( | ||
text, //text to be converted | ||
font, //define the font face | ||
colors, //define all colors | ||
background, //define the background color | ||
letterSpacing, //define letter spacing | ||
space, //define if the output text should have empty lines on top and on the bottom | ||
maxLength //define how many character can be on one line | ||
); | ||
var fonts = new FONTS({ | ||
'text': 'Hello World', //text to be converted | ||
'font': 'block', //define the font face | ||
'colors': '', //define all colors | ||
'background': 'Black', //define the background color | ||
'letterSpacing': '1', //define letter spacing | ||
'space': true, //define if the output text should have empty lines on top and on the bottom | ||
'maxLength': '10' //define how many character can be on one line | ||
}); | ||
``` | ||
@@ -261,2 +261,3 @@ | ||
## Release History | ||
* 0.0.7 - changed to settings object | ||
* 0.0.6 - added `3d` font | ||
@@ -263,0 +264,0 @@ * 0.0.5 - added grunt test |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87443
1616
270
3
70