Can use multiline text from the command line

This commit is contained in:
mmcwilliams 2021-05-05 19:59:06 -04:00
parent d40edeff47
commit 45d619183f
1 changed files with 3 additions and 3 deletions

View File

@ -42,13 +42,13 @@ async function loadFont (fontPath) {
async function main () { async function main () {
const fontPath = args.font; const fontPath = args.font;
const text = args.text; const text = args.text.replace('\\n', '\n');
const lines = text.split('\n');
const size = args.size || '8.5x11'; const size = args.size || '8.5x11';
const output = args.output || 'sticky.svg'; const output = args.output || 'sticky.svg';
let data; let data;
//console.log(fontPath) //console.log(fontPath)
console.log(text)
try { try {
//await loadFont(fontPath); //await loadFont(fontPath);
@ -56,7 +56,7 @@ async function main () {
console.error(err); console.error(err);
} }
options.pos = { x: 10, y: 10 }; options.pos = { x: 500, y: 10 };
//options.pos = textPos(text); //options.pos = textPos(text);
data = hershey.renderTextSVG(text, options); data = hershey.renderTextSVG(text, options);
//console.log(`${header}\n${data}\n${footer}`) //console.log(`${header}\n${data}\n${footer}`)