Reputation: 43
So, I'm trying to use a custom font with canvas in this way:
canva.registerFont('./src/fonts/alternate-gothic-cond-atf.otf', { family: 'Alternate Gothic Cond ATF' });
ctx.font = '60px Alternate Gothic Cond ATF'
and get this: (process:4992): Pango-WARNING **: 15:26:26.259: couldn't load font "Alternate Gothic Cond ATF Condensed 60px", falling back to "Sans Condensed 60px", expect ugly output.
I tried with different fonts and works fine, so I don't know why this won't work, I also tried to reinstall the font, but nothing changed.
Edit: Since the other font I tried was .ttf I converted the file to .tff but no progress have been made.
Upvotes: 0
Views: 430
Reputation: 259
Currently experiencing same issue in my project, it seems you need to have the font installed on your machine for Pango to load it properly.
Upvotes: 0