processing/p5.js

[p5.js 2.0 Beta Bug Report]: Document difference between textWidth and fontWidth with respect to whitespace

Open

#7.745 geöffnet am 17. Apr. 2025

Auf GitHub ansehen
 (24 Kommentare) (0 Reaktionen) (1 zugewiesene Person)JavaScript (3.178 Forks)batch import
Area:TypographyBugDocumentationGood First IssueHelp Wantedp5.js 2.0+

Repository-Metriken

Stars
 (20.784 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 9T 8h) (56 gemergte PRs in 30 T)

Beschreibung

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