Font settings

This commit is contained in:
loicbersier 2020-02-21 20:05:48 +01:00
parent d4fbb7deaa
commit a5a1bcfff7

View file

@ -38,6 +38,16 @@ class posterCommand extends Command {
flag: '--height', flag: '--height',
default: 200 default: 200
}, },
{
id: 'title',
match: 'option',
flag: '--titleSize',
},
{
id: 'subtext',
match: 'option',
flag: '--subtextSize',
},
], ],
description: { description: {
content: 'Create demotivational poster (use ``|`` to separate top text and bottom text) WIP', 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 TOP_POS = Math.abs((value.height / 2) - PADDING + 110);
const BOTTOM_POS = Math.abs((value.height / 2) - PADDING + 180); const BOTTOM_POS = Math.abs((value.height / 2) - PADDING + 180);
const FONT_SIZE1 = (value.width / 12); let FONT_SIZE1 = (value.width / 12);
const FONT_SIZE2 = (value.width / 12) - 15; 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_WIDTH = args.width;
let BORDER_HEIGHT = args.height; let BORDER_HEIGHT = args.height;