Comparing version 0.0.10 to 0.0.11
27
index.js
@@ -41,2 +41,17 @@ /* | ||
function equalWidth($character) { | ||
var charWidth = 0; | ||
for(var w = $character.length - 1; w >= 0; w--) { | ||
$char = $character[w].replace(/(<([^>]+)>)/ig, ''); | ||
if( $char.length > charWidth ) { | ||
charWidth = $char.length; | ||
} | ||
}; | ||
return charWidth; | ||
} | ||
//-------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
@@ -58,3 +73,3 @@ // Main logic | ||
var $input = $SETTINGS.text; //text to be converted | ||
var FONTS = '*console*block*simple*3d*'; //all supported font files | ||
var FONTS = '*console*block*simple*3d*simple3d*'; //all supported font files | ||
var $font = {}; //the font object | ||
@@ -78,3 +93,3 @@ OPTIONS.background = changeCase.upperCaseFirst(OPTIONS.background); //background color case convertion | ||
console.log("\n" + ' Please use a font from the support stack: ' + | ||
chalk.styles.green.open + '[ console | block | simple | 3d ]' + chalk.styles.green.close + "\n"); | ||
chalk.styles.green.open + '[ console | block | simple | 3d | simple3d ]' + chalk.styles.green.close + "\n"); | ||
process.exit(1); | ||
@@ -116,2 +131,4 @@ } | ||
var charWidth = equalWidth( $font.chars[ $char ] ); | ||
for(var c = 0, l = $font.lines; c < l; c++) { //iterate over font face lines | ||
@@ -121,2 +138,8 @@ | ||
if( $character.length < charWidth ) { | ||
for(var w = (charWidth - $character.length) - 1; w >= 0; w--) { | ||
$character += ' '; | ||
}; | ||
} | ||
$character = colorize($font, OPTIONS, $character); | ||
@@ -123,0 +146,0 @@ |
{ | ||
"name": "cfonts", | ||
"description": "Sexy fonts for the console", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"homepage": "https://github.com/dominikwilkowski/cfonts", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -170,6 +170,7 @@ ```shell | ||
* `console` [colors: 1] | ||
* `block` [colors: 2] | ||
* `simple` [colors: 1] | ||
* `3d` [colors: 2] | ||
* `console` [colors: 1] | ||
* `block` [colors: 2] | ||
* `simple` [colors: 1] | ||
* `3d` [colors: 2] | ||
* `simple3d` [colors: 1] | ||
@@ -263,2 +264,3 @@ ```shell | ||
## Release History | ||
* 0.0.11 - added simple3d font | ||
* 0.0.10 - added npmignore, added to docs | ||
@@ -277,2 +279,2 @@ * 0.0.9 - added console font | ||
## License | ||
Copyright (c) 2015 Dominik Wilkowski. Licensed under the [MIT license](https://github.com/dominikwilkowski/cfonts/blob/master/LICENSE). | ||
Copyright (c) 2015 Dominik Wilkowski. Licensed under the [GNU GPL](https://github.com/dominikwilkowski/cfonts/blob/master/LICENSE). |
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
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
91919
12
2153
277