Skip to content

textToModel() throws when called with space character (' ') #8428

@skyash-dev

Description

@skyash-dev

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

2.0.3

Web browser and version

No response

Operating system

No response

Calling textToModel() with a space character (' ') throws a runtime error.
This appears to be a regression. It should not crash the function.

This currently breaks the Typography 2.0 tutorial on the p5.js website. (https://beta.p5js.org/tutorials/typography-20/)

Steps to reproduce

  1. Open a WEBGL sketch
  2. Load a font
  3. Call:
font.textToModel(' ', 0, 0);

Throws:
TypeError: can't access property "vertices", n is undefined

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions