D
D
danyarubcov2019-03-30 23:25:26
Node.js
danyarubcov, 2019-03-30 23:25:26

TypeError: Font is not a constructor?

let Font = canvas.Font;
let CoreSansE = new Font('CoreSansE-25ExtraLight', __dirname + '/base/fonts/CoreSansE-25ExtraLight.otf');
I catch an error - TypeError: Font is not a constructor

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-03-31
@grinat

It also says that this is not a constructor. In general, if this is a canvas, then the font changes as ctx.font, it is registered like this: https://github.com/Automattic/node-canvas/#registerfont

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question