From a5a1bcfff71fe14e715c6c5ffe0cb4e529797ece Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 21 Feb 2020 20:05:48 +0100 Subject: [PATCH] Font settings --- commands/images/poster.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/commands/images/poster.js b/commands/images/poster.js index 900a5fe..f07f991 100644 --- a/commands/images/poster.js +++ b/commands/images/poster.js @@ -38,6 +38,16 @@ class posterCommand extends Command { flag: '--height', default: 200 }, + { + id: 'title', + match: 'option', + flag: '--titleSize', + }, + { + id: 'subtext', + match: 'option', + flag: '--subtextSize', + }, ], description: { content: 'Create demotivational poster (use ``|`` to separate top text and bottom text) WIP', @@ -93,8 +103,10 @@ class posterCommand extends Command { const TOP_POS = Math.abs((value.height / 2) - PADDING + 110); const BOTTOM_POS = Math.abs((value.height / 2) - PADDING + 180); - const FONT_SIZE1 = (value.width / 12); - const FONT_SIZE2 = (value.width / 12) - 15; + let FONT_SIZE1 = (value.width / 12); + if (args.title) FONT_SIZE1 = args.title; + let FONT_SIZE2 = (value.width / 12) - 15; + if (args.subtext) FONT_SIZE2 = args.subtext; let BORDER_WIDTH = args.width; let BORDER_HEIGHT = args.height;