Skip to content

Commit 9b16300

Browse files
committedJul 23, 2020
vertical smushing bug fix
1 parent faeb2f1 commit 9b16300

File tree

6 files changed

+23
-4
lines changed

6 files changed

+23
-4
lines changed
 

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ figlet -f "Dancing Font" "Hi"
338338
For more info see the [figlet-cli](https://github.com/patorjk/figlet-cli).
339339

340340
## Release History
341+
* 2020.07.12 v1.5.1 Fixed with with vertical smushing, updated lodash version.
341342
* 2020.07.12 v1.5.0 Added width and whitespaceBreak options.
342343
* 2020.04.26 v1.4.0 Removed jQuery from preloader and examples.
343344
* 2020.02.23 v1.3.0 Added the "ANSI Regular" font and updated the README with info on how to use with Webpack.

‎fonts/Slant.flf

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
flf2a$ 6 5 16 15 12 0 17807
1+
flf2a$ 6 5 16 15 10 0 18319
22
Slant by Glenn Chappell 3/93 -- based on Standard
33
Includes ISO Latin-1
44
figlet release 2.1 -- 12 Aug 1994
@@ -9,8 +9,6 @@ Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
99
supported by FIGlet and FIGWin. May also be slightly modified for better use
1010
of new full-width/kern/smush alternatives, but default output is NOT changed.
1111
12-
Modified by Patrick Gillespie (patorjk) on 2020/07/23 to fix vertical layout issue (ref: https://github.com/patorjk/figlet.js/issues/61)
13-
1412
$$@
1513
$$ @
1614
$$ @

‎lib/figlet.js

+1
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ var figlet = figlet || (function() {
390390
} else if (opts.fittingRules.vLayout === SMUSHING) {
391391
result += uni_Smush(ch1,ch2);
392392
} else {
393+
validSmush = false;
393394
validSmush = (opts.fittingRules.vRule5) ? vRule5_Smush(ch1,ch2) : validSmush;
394395
validSmush = (!validSmush && opts.fittingRules.vRule1) ? vRule1_Smush(ch1,ch2) : validSmush;
395396
validSmush = (!validSmush && opts.fittingRules.vRule2) ? vRule2_Smush(ch1,ch2) : validSmush;

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "figlet",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Creates ASCII Art from text. A full implementation of the FIGfont spec.",
55
"keywords": [
66
"figlet",

‎test/expected/verticalSmushRule2

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
______ _ __
2+
/_ __/__ _________ ___ (_)___ ____ _/ /
3+
/ / / _ \/ ___/ __ `__ \/ / __ \/ __ `/ /
4+
/ / / __/ / / / / / / / / / / / /_/ / /
5+
/_/__\___/_/ /_/ /_/ /_/_/_/ /_/\__,_/_/
6+
/ ____/ /_ ___ __________
7+
/ / / __ \/ _ \/ ___/ ___/
8+
/ /___/ / / / __(__ |__ )
9+
\____/_/ /_/\___/____/____/
10+

‎test/figlet_test.js

+9
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ exports.figlet = {
200200

201201
test.done();
202202
},
203+
verticalSmushRule2: function(test) {
204+
test.expect(1);
205+
206+
var expected = grunt.file.read('test/expected/verticalSmushRule2');
207+
var actual = figlet.textSync('Terminal\nChess', {font: 'Slant'});
208+
test.equal(actual, expected, 'Vertical Smush Rule 2 should be followed.');
209+
210+
test.done();
211+
},
203212
printDirection: function(test) {
204213
test.expect(1);
205214

0 commit comments

Comments
 (0)
Please sign in to comment.