I use node-canvas, and use registerFont to use a specific font. This works fine locally on Windows, but when hosting my project on my Linux VPS it doesn't. It recognizes the path, because else it would give an error. When I use a different and bold font, it still doesn't use the font, but it does make the default font bold.
I tried using chmod to make sure my project has permission to use the file (the file is loaded locally). I tried formatting it to woff and use that instead.
const font = 'Gabrielle';
registerFont(`assets/${font}.ttf`, { family: font });
ctx.font = `24px ${font}`;
I looked at the documentation and found that registering the font must happen before creating the canvas. On Windows this is apparently no problem, but on Linux it is.