From 48c46b8a5cf91e06a85751733bab7d5f84685335 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 21 Feb 2020 21:07:54 +0100 Subject: [PATCH] font size settings --- commands/images/meme.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commands/images/meme.js b/commands/images/meme.js index 8d3ba85a..4e293cde 100644 --- a/commands/images/meme.js +++ b/commands/images/meme.js @@ -25,6 +25,11 @@ class memeCommand extends Command { }, type: 'string', match: 'rest' + }, + { + id: 'fontSize', + match: 'option', + flag: '--fontSize', } ], description: { @@ -79,7 +84,7 @@ class memeCommand extends Command { // Set text position for top and bottom const TOP_POS = Math.abs((value.height / 2) - PADDING) * -1; const BOTTOM_POS = (value.height / 2) - PADDING; - const FONT_SIZE = (value.width / 10); + let FONT_SIZE = args.fontSize == true ? args.fontSize : (value.width / 10); // Write text on image using graphicsmagick img.font(FONT, FONT_SIZE)