[p5.js 2.0 Beta Bug Report]: Document difference between textWidth and fontWidth with respect to whitespace
Open
@Sushma-1706 is already working on this.
Since Sep 18, 2025.
Area:Typography
Bug
Documentation
Good First Issue
Help Wanted
p5.js 2.0+
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
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
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
Latest dev-2.0
Web browser and version
Firefox
Operating system
MacOS
Steps to reproduce this
This logs 0 in 2.0 but something around 5 in 1.x:
function setup() {
createCanvas(200, 200)
textSize(20)
console.log(textWidth(' '))
}
Live: https://editor.p5js.org/davepagurek/sketches/xlqZOPgIR
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.