Skip to content
Snippets Groups Projects
Commit c5af0423 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Support combination use of tdfiglet -x and -r options

e.g. to use only the first font (index 0) from a randomly selected font file.
parent c9086f14
No related branches found
No related tags found
No related merge requests found
...@@ -84,7 +84,7 @@ function loadfont(fn_arg) { ...@@ -84,7 +84,7 @@ function loadfont(fn_arg) {
try { try {
const sequence = "\x55\xaa\x00\xff"; const sequence = "\x55\xaa\x00\xff";
if(this.opt && opt.random) if(this.opt && opt.random && opt.index === undefined)
opt.index = random(map.split(sequence).length); opt.index = random(map.split(sequence).length);
if(this.opt && opt.index>0) { if(this.opt && opt.index>0) {
......
...@@ -12,8 +12,7 @@ opt = { ...@@ -12,8 +12,7 @@ opt = {
justify: LEFT_JUSTIFY, justify: LEFT_JUSTIFY,
width: DEFAULT_WIDTH, width: DEFAULT_WIDTH,
random: false, random: false,
info: false, info: false
index: 0
}; };
// Function declarations (Synchronet JS style) // Function declarations (Synchronet JS style)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment