From 45d619183f09f3892cf42a356088f458171a99f4 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Wed, 5 May 2021 19:59:06 -0400 Subject: [PATCH] Can use multiline text from the command line --- sticky/sticky.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sticky/sticky.js b/sticky/sticky.js index 07db756..63eb019 100755 --- a/sticky/sticky.js +++ b/sticky/sticky.js @@ -42,13 +42,13 @@ async function loadFont (fontPath) { async function main () { const fontPath = args.font; - const text = args.text; - const lines = text.split('\n'); + const text = args.text.replace('\\n', '\n'); const size = args.size || '8.5x11'; const output = args.output || 'sticky.svg'; let data; //console.log(fontPath) + console.log(text) try { //await loadFont(fontPath); @@ -56,7 +56,7 @@ async function main () { console.error(err); } - options.pos = { x: 10, y: 10 }; + options.pos = { x: 500, y: 10 }; //options.pos = textPos(text); data = hershey.renderTextSVG(text, options); //console.log(`${header}\n${data}\n${footer}`)