You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have 3 custom font files, which contain the same font (Beach Pro Bold). I want to register them under 3 different families: Beach Pro Bold, Beach Pro Bold1, Beach Pro Bold2.
I register them properly, but when I am trying to render 3 different texts (one text per font family above), I see that Beach Pro Bold1 renders as the default system's font (screenshot).
registerFont('./Beach Pro Bold_20250117181956_20250125071027.otf'), {
family: 'Beach Pro Bold',
weight: 700,
style: 'normal'
})
registerFont('./Beach Pro Bold_20250119095142_20250125071053.otf'), {
family: 'Beach Pro Bold1',
weight: 700,
style: 'normal'
})
registerFont('./Beach Pro Bold_20250119095811_20250125071118.otf'), {
family: 'Beach Pro Bold2',
weight: 700,
style: 'normal'
})
const canvasNode = createCanvas(500, 500)
const ctxNode = canvasNode.getContext('2d')
ctxNode.font = '12px "Beach Pro Bold"';
ctxNode.fillText('Beach Pro Bold', 250, 10);
ctxNode.font = '12px "Beach Pro Bold1"';
ctxNode.fillText('Beach Pro Bold1', 250, 30);
ctxNode.font = '12px "Beach Pro Bold2"';
ctxNode.fillText('Beach Pro Bold2', 250, 50);
Weird enough, if I remove Beach Pro Bold2, then Beach Pro Bold1 will render correctly.
System:
Node: 18.20.6
Canvas: 2.10.2
OS: built using Docker image node:18-alpine
Misc: It is just vanilla canvas project
The text was updated successfully, but these errors were encountered:
Hello, I have 3 custom font files, which contain the same font (
Beach Pro Bold
). I want to register them under 3 different families:Beach Pro Bold
,Beach Pro Bold1
,Beach Pro Bold2
.I register them properly, but when I am trying to render 3 different texts (one text per font family above), I see that
Beach Pro Bold1
renders as the default system's font (screenshot).Weird enough, if I remove
Beach Pro Bold2
, thenBeach Pro Bold1
will render correctly.System:
Node: 18.20.6
Canvas: 2.10.2
OS: built using Docker image node:18-alpine
Misc: It is just vanilla canvas project
The text was updated successfully, but these errors were encountered: