text() with maxWidth and maxHeight removes '\t' tabs
Open
Nobody has claimed this yet.
Area:Core
Area:Typography
Bug
- 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
- p5.strands
- WebGL
- DevOps, Build process, Unit testing
- Internationalization (i18n)
- Friendly Errors
- Other (specify if possible)
p5.js version
1.11.11
Web browser and version
Chrome 143.0.7499.193
Operating system
MacOSX 13.6.5
Steps to reproduce this
Steps:
- Create
text()with text containing tabs\t - Give textbox a maxWidth and maxHeight
- Tabs are stripped from text
Snippet:
function setup() {
createCanvas(windowWidth, windowHeight)
}
function draw() {
background(0)
fill(255)
let txt = 'here is \n\tsome text'
textSize(50)
text(txt, 0, 0) // has tabs
// text(txt, 0, 0, width, height) // removes tabs
}
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.
Research direction
Start with the p5.js text() behavior shown in the reproduction snippet, comparing calls with and without maxWidth and maxHeight. Confirm that tab characters are preserved when constrained text is rendered, and verify the result by rerunning the provided browser example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100