Skip to content

text() with maxWidth and maxHeight removes '\t' tabs #8469

@ffd8

Description

@ffd8

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:

  1. Create text() with text containing tabs \t
  2. Give textbox a maxWidth and maxHeight
  3. 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
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions