SrGobi/canvacard

How to change font welcomer ?

Closed this issue · 3 comments

How to change font welcomer ?

It's not documented, but if you check out /src/Welcomer.js Line 325:

async build(ops = { fontX: "Manrope", fontY: "Manrope" }) {

You will see .build() can take an object argument.
The object being: {fontX: "fontX_here", fontY: "fontY-here"}

With this said, the font can be controlled, under the condition, that the font is within the registered fonts.
You can find which fonts are registered and can be used, if you check out: /src/Welcomer.js Line 94:

registerFonts(fontArray = []) {

With all this information you can do such:

welcomer.build({ fontX: "Burkank Big Condensed", fontY: "Burkank Big Condensed" })
  .then(data => {
    const attachment = new Discord.MessageAttachment(data, "WelcomerCard.png");
    message.channel.send(attachment);
  });

The fontX and fontY is simply the Family: string, provided in the registered fonts, which I linked above.

Instead of having to figure that out yourself, I provided the available options to use:

//Sans Heavy
.build({ fontX: "Sans Heavy", fontY: "Sans Heavy" })

//Burbank Big Condensed
.build({ fontX: "Burkank Big Condensed", fontY: "Burkank Big Condensed"})

//Keep Calm Medium
.build({ fontX: "Keep Calm Medium", fontY: "Keep Calm Medium"})

//Luckiest Guy
.build({ fontX: "Luckiest Guy", fontY: "Luckiest Guy"})

//Manrope Bold
.build({ fontX: "Manrope Bold", fontY: "Manrope Bold"})

//Manrope
.build({ fontX: "Manrope", fontY: "Manrope"})

//Roboto Black
.build({ fontX: "Roboto Black", fontY: "Roboto Black"})

//Roboto Light
.build({ fontX: "Roboto Light", fontY: "Roboto Light"})

//Roboto
.build({ fontX: "Roboto", fontY: "Roboto"})

//SketchMatch
.build({ fontX: "SketchMatch", fontY: "SketchMatch"})

//The Bolt Font
.build({ fontX: "The Bolt Font", fontY: "The Bolt Font"})

//Twitter Color Emoji
.build({ fontX: "Twitter Color Emoji", fontY: "Twitter Color Emoji"})

//Whitney-Book
.build({ fontX: "Whitney-Book", fontY: "Whitney-Book"})

//Whitney
.build({ fontX: "Whitney", fontY: "Whitney"})

No description provided.

Hopefully the above information allows you to find one of the registered fonts that works best for you.

It's worked, thanks brother