Open TehreemFarooqi opened 3 months ago
@TehreemFarooqi Font.fromFileSync returns font name. Usage of font family is not supported so you will have to use the name returned by Font.fromFileSync method. Alternatively, the second argument takes the name of the font, you can set it there for it to work.
Something like this
const font = Font.fromFileSync('path/to/font.ttf');
// Or
const font = Font.fromFileSync('path/to/font.ttf', 'my-font');
fontFamily: font.name
// or
fontFamily: 'my-font'
Hi, I am trying to use custom fonts in a canvacord project.
In my
index.js
, I am loading fonts like this:Then in my
template.js
file, I am trying to use these fonts as such:The image I get at the end just uses the font first loaded for all text elements. If I write:
then my final image with have all text with Inter font.
My canvacord version is
v6.0.2
.I couldn't find detailed documentation on using custom fonts in canvacord. How do I solve this and can you point me to the documentation for this?
@twlite