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
Hi @isasasasa! I'm trying to reproduce this issue on my end, but haven't been able to so far. If you see my sketch: https://editor.p5js.org/doradocodes/sketches/nmK9yJaRo I have uploaded a font the same way you did, and it is working as expected. My current p5 version is 2.3.2.
Please share your sketch here, and we can do some further debugging!
Was able to reproduce this — but only when using a custom loaded font, not a font-family string. With textFont('Georgia') (string), no error. But with:
js
async function preload() {
customFont = await loadFont('adamina.ttf');
}
function setup() {
textFont(customFont);
}
I get:
[p5.js, line 102426] Cannot read property of undefined.
Error at line 102426 in fn._handleMotion()
Called from line 102413 in fn._ondeviceorientation()
So the failure seems triggered by a device orientation/motion event handler, not the font loading itself — possibly an unrelated event listener throwing when textFont() with a custom font is in the call stack. p5.js 2.3.2, macOS, Chrome. @isasasasa — were you also using a custom loaded font, or a font-family string?
Activity
doradocodes commentedon Sep 13, 2026
Hi @isasasasa! I'm trying to reproduce this issue on my end, but haven't been able to so far. If you see my sketch: https://editor.p5js.org/doradocodes/sketches/nmK9yJaRo I have uploaded a font the same way you did, and it is working as expected. My current p5 version is 2.3.2.
Please share your sketch here, and we can do some further debugging!
ANUBHAVSINGH30 commentedon Sep 14, 2026
Was able to reproduce this — but only when using a custom loaded font, not a font-family string. With textFont('Georgia') (string), no error. But with:
js
async function preload() {
customFont = await loadFont('adamina.ttf');
}
function setup() {
textFont(customFont);
}
I get:
[p5.js, line 102426] Cannot read property of undefined.
Error at line 102426 in fn._handleMotion()
Called from line 102413 in fn._ondeviceorientation()
So the failure seems triggered by a device orientation/motion event handler, not the font loading itself — possibly an unrelated event listener throwing when textFont() with a custom font is in the call stack. p5.js 2.3.2, macOS, Chrome. @isasasasa — were you also using a custom loaded font, or a font-family string?