Closed ghost closed 8 years ago
Thanks for the insight, but if you actually run the code you'll see it will work as the example is written.
The reason why is the lines following the function header you point out:
if(typeof style == 'function'){
callback = style;
style = undefined;
}
If I've missed another case, please let me know otherwise I'll close this.
There is a tincy tiny bug in the example.js:
The example looks like this:
art.font('Demo!', 'Doom', function(rendered){ console.log(art.style(rendered, 'blue_bg+red+blink+inverse')); });
But the implementation looks like:
AsciiArt.font = function(str, fontName, style, callback)
ie. In the example the "style" parameter is never set, causing things to behave unexpected. Working example:
var style = null; // or use an actual style
art.font('Demo!', 'Doom', style, function(rendered){ console.log(art.style(rendered, 'blue_bg+red+blink+inverse')); });