Open
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build Process
- Unit Testing
- Internalization
- Friendly Errors
- Other (specify if possible)
p5.js version
1.7.0
Web browser and version
FF 115.0.2
Operating System
mac 12.6
Steps to reproduce this
Steps:
- input number to textBounds
Snippet:
https://editor.p5js.org/micuat/sketches/sYWYkUTJv
let f;
function preload() {
f = loadFont("RobotoMono-VariableFont_wght.ttf")
}
function setup() {
createCanvas(400, 400);
console.log(f.textBounds("io", 0, 0, 10))
console.log(f.textBounds(10, 0, 0, 10))
}
function draw() {
background(220);
}
console:
{x: 0.9912109375, y: -7.2021484375, h: 7.2998046875, w: 10.41015625, advance: 0.9912109375}
{x: Infinity, y: Infinity, h: -Infinity, w: 0, advance: Infinity}
I'm not sure what is the expected result (number + "" would solve the issue). If number is not accepted, there should be an error message, I suppose?